envdiff

envfile diff tool

Installation

go install github.com/yoskeoka/[email protected]

Usage

Print environment variables that the file2 contains more.

envdiff file1 file2

$ envdiff -help
Usage of envdiff:
  -check
        If the result has diff, it exits with code 1.
  -cmpval
        compare value (default: off)
  -filter value
        Filter by env key pattern. Multi filters may be specified. e.g: -filter="KEY_*"
  -help
        Print this help message.
  -ignore value
        Ignore by env key pattern. Multi ignores may be specified. e.g: -ignore="FOO_*"
  -version
        Print version.

Example: envdiff envfile1 envfile2

Example

file1

KEY1=VAL1

file2

KEY1=VAL1
KEY2=VAL2

$ envdiff file1 file2
KEY2=VAL2

Update file1 with the diff.

envdiff file1 file2 >> file1

GitHub

View Github