Adds correct order of env file loading, from local to global.
This commit is contained in:
parent
f6291bf8ba
commit
9012c5b541
12
README.md
12
README.md
@ -29,15 +29,23 @@ Usage: octojpack [OPTION...]
|
|||||||
Packager url
|
Packager url
|
||||||
example: octojpack -pu="https://git.vdm.dev/"
|
example: octojpack -pu="https://git.vdm.dev/"
|
||||||
======================================================
|
======================================================
|
||||||
|
-md | --main-dir=<path>
|
||||||
|
load the main working directory
|
||||||
|
example: octojpack --main-dir=/src
|
||||||
|
======================================================
|
||||||
-e | --env=<file>
|
-e | --env=<file>
|
||||||
load the environment variables file
|
load the environment variables file
|
||||||
example: octojpack --env=/src/.env
|
example: octojpack --env=/src/.env
|
||||||
======================================================
|
======================================================
|
||||||
--conf | --config=<path>
|
--conf | --config=<path/url>
|
||||||
load the configuration for the package in json format
|
load the configuration for the package in json format
|
||||||
file-example: src/example.json
|
file-example: src/example.json
|
||||||
example: octojpack --config=config.json
|
example: octojpack --config=config.json
|
||||||
======================================================
|
======================================================
|
||||||
|
-ld | --licence-dir=<path>
|
||||||
|
load the licence directory
|
||||||
|
example: octojpack --licence-dir=/src/licence
|
||||||
|
======================================================
|
||||||
-t | --token=<access_token>
|
-t | --token=<access_token>
|
||||||
load the global token
|
load the global token
|
||||||
example: octojpack --token=xxxxxxxxxxxxxxxxxxxxxxxxx
|
example: octojpack --token=xxxxxxxxxxxxxxxxxxxxxxxxx
|
||||||
@ -67,7 +75,7 @@ Usage: octojpack [OPTION...]
|
|||||||
example: octojpack -h
|
example: octojpack -h
|
||||||
example: octojpack --help
|
example: octojpack --help
|
||||||
======================================================
|
======================================================
|
||||||
Octojpack v1.0
|
Octojpack
|
||||||
======================================================
|
======================================================
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1277,11 +1277,11 @@ tmp_path="${VDM_MAIN_DIR}/licenses"
|
|||||||
VDM_LICENSE_DIR="${VDM_LICENSE_DIR:-$tmp_path}"
|
VDM_LICENSE_DIR="${VDM_LICENSE_DIR:-$tmp_path}"
|
||||||
|
|
||||||
# the environment file variables path
|
# the environment file variables path
|
||||||
tmp_path="/home/$USER/.config/${PROGRAM_CODE}/.env"
|
tmp_path="$PWD/.env_${PROGRAM_CODE}"
|
||||||
# if file not set try $PWD path
|
# if file not set try $PWD path
|
||||||
[ -f "$tmp_path" ] || tmp_path="$PWD/.env_${PROGRAM_CODE}"
|
|
||||||
# if file not set try $VDM_MAIN_DIR path
|
|
||||||
[ -f "$tmp_path" ] || tmp_path="$VDM_MAIN_DIR/.env_${PROGRAM_CODE}"
|
[ -f "$tmp_path" ] || tmp_path="$VDM_MAIN_DIR/.env_${PROGRAM_CODE}"
|
||||||
|
# if file not set try $VDM_MAIN_DIR path
|
||||||
|
[ -f "$tmp_path" ] || tmp_path="/home/$USER/.config/${PROGRAM_CODE}/.env"
|
||||||
# ALWAYS USE GLOBAL IF SET
|
# ALWAYS USE GLOBAL IF SET
|
||||||
VDM_ENV_FILE_PATH="${VDM_ENV_FILE_PATH:-$tmp_path}"
|
VDM_ENV_FILE_PATH="${VDM_ENV_FILE_PATH:-$tmp_path}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user