envinit is a tool for manage the environments of project. usually, the dev enviroment is not equal to the prod environment, so we can use this tool to manage the environment.
step1:
git glone and install the tool
git clone [email protected]:buptlsp/codetool.git
cd codetool
sudo ./install
step2:
initial the environment. if you have already initial the environment, you can skip this step.
cd your_project
envinit init
# you can edit ./environments/config.json to edit your environments
step3:
sync the environment
cd your_project
envinit run
# you can just run envinit to see the params
envinit
envinit --help
the script will copy ./environments/{envName}/a/b/config.xx
to ./a/b/config.txt
,thus, we can save our environments in ./environments
.
Tips: the ./environments
should add to git, and the destfile should add to gitignore.