envsync

package module
v0.0.0-...-996e87c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 5 Imported by: 0

README

envsync

Coverage Status

envsync-image

GoDoc Build Status Go Report Card

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.

Operating system, programming language and framework agnostic

The command runs on all three main platforms (Linux, Mac, Windows), it is programming languages and frameworks agnostic.

Built on top of gotdotenv.

Installation

Library
go get github.com/claudiunicolaa/envsync
Bin Command
go get github.com/claudiunicolaa/envsync/cmd/envsync

Usage

Library
package main

import (
	"fmt"
	"github.com/claudiunicolaa/envsync"
)

func main() {
	_, err := envsync.EnvSync(".env", ".env.example")

	if err != nil {
		fmt.Println(err)
		return
	}
	// ...
}

Bin command

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

Something wrong?

If you encounter some problems, please open an issue.

Documentation

Overview

Package envsync provide a simple checking tool if environment and environment example files are synced. The check take into consideration the keys, not the values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvSync

func EnvSync(envFileName, envFileNameExample string) (bool, error)

EnvSync has two parameter:

  • the environment filename
  • the environment example filename

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL