Skip to content

Harichandra-Prasath/SyncEnv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SyncEnv

Simple Open Source tool to Track and load the environment variables specified to directory

Table of Contents

  1. Installation
  2. Usage
  3. Hooking
  4. Future Work
  5. Contributions

Installation

  1. Install the binary
go install github.com/Harichandra-Prasath/SyncEnv

Usage

Initialise
This action adds the current directory to SycnEnv store.

SyncEnv init

Additionally if you want to migrate local variabales that you have already, use --with-file.

SyncEnv init --with-file <path-to-file>

Additon
You can add new variables

SyncEnv --add foo=bar --add baz=gaz  

Updation
You can update existing variables

SyncEnv --update foo=gaz --update baz=bar

Loading
This is the action where SyncEnv loads the attached variables. As child process cannot write to it's Parent, you need to run this action with bash eval.

eval `SyncEnv load`  

If you want to load from a local file, add --from-file flag.

eval `SyncEnv load --from-file <path-to-file>`

Additionally, --no-debug flag can be passed to prevent message outputs.

eval `SyncEnv load --no-debug`

Peek
You can see all the variables in the store

SyncEnv --peek

Port
You can Port your SyncEnv variables to a standalone file.

SyncEnv --port <path-to-file>

Help
To see the help menu

SyncEnv --help

Hooking

For auto-loading of variables when entering the directory, you can create a hook in your shell profile.

Currently SyncEnv supports zsh and bash.

For Zsh, add the below in your .zshrc

eval "$(SyncEnv hook --shell zsh)"

For Bash, add the below in your .bashrc

eval "$(SyncEnv hook --shell bash)"

Future-Work

  1. Port to Windows
  2. Additional Shells like fish,etc..
  3. Reducing Write actions if possible

Contributions

This is a small project open to everyone.Contributions and improvements are always welcome.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages