GithubHelp home page GithubHelp logo

file-mod's Introduction

file-mod

File mod is a command line go utility to modify files. Below you can find the the availability and usage.

Installation

You can install the file-mod component for a specific OS at https://github.com/chef/file-mod/releases

Currently available for:

OS ARCH
Darwin x86_64 (amd64), arm64
Linux x86_64 (amd64), arm64
Windows x86-64 (amd64)

Build

You can optionally build file-mod via the goreleaser utility. Goreleaser uses a .goreleaser.yml to define how you would like to build and release your go binary(ies).

file-mod

Command line utility to modify files.

Usage:
  file-mod [command]

Available Commands:
  append-if-missing Append STRING to FILE if not already there.
  find-and-replace  Replace REGEX_STR with STRING in FILE. Supports multiline replace.
  help              Help about any command

Flags:
  -h, --help   help for file-mod

Use "file-mod [command] --help" for more information about a command.

find-and-replace Sample Usage

This tool uses the regexp library under the covers.

# Update indented version reference in file (single line)
VERSION=$(cat VERSION)
file-mod find-and-replace "(?m)(\s+)VERSION = \".+\"" "\${1}VERSION = \"$VERSION\"" myfile.ext

file-mod's People

Contributors

chef-ci avatar nkierpiec avatar tduffield avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.