A simple command for checking if the environment and the environment example files are synced. Under the hood, the command checks if the files have the same keys. It can be used as a library or as a bin command.
The command runs on all three main platforms (Linux, Mac, Windows), it is programming languages and frameworks agnostic.
Built on top of gotdotenv.
go get github.com/claudiunicolaa/envsync
go get github.com/claudiunicolaa/envsync/cmd/envsync
package main
import (
"fmt"
"github.com/claudiunicolaa/envsync"
)
func main() {
_, err := envsync.EnvSync(".env", ".env.example")
if err != nil {
fmt.Println(err)
return
}
// ...
}
Install as above and you can run it like as a bin command from your terminal.
envsync [-h] path/to/environment/example/file [path/to/environment/file]
// The above Go code can be translated into
envsync .env.example .env
If you encounter some problems, please open an issue.