Browse Source

Enable overriding configuration using environment variables

master
Maxime Wack 3 months ago
parent
commit
4f1945690d
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      git-ommix

+ 8
- 2
git-ommix View File

@@ -10,6 +10,9 @@ IFS=$'\n\t'
# Load git ommix functions
# Load global and local settings if they exist

# Save env variables
envs=$(env | grep ^GIT_OMMIX)

TEST_OMMIX="${TEST_OMMIX:-}"
if [[ "$TEST_OMMIX" ]]; then
source $(dirname $0)/functions
@@ -20,6 +23,9 @@ fi
[[ -f "/etc/gitommix.conf" ]] && source "/etc/gitommix.conf"
[[ -f "$HOME/.config/gitommix.conf" ]] && source "$HOME/.config/gitommix.conf"

# Restore env variables after config load
eval $envs

###############################################################################
# Parse arguments
# Initialize default values
@@ -38,8 +44,8 @@ PROVIDER="${PROVIDER:-}"
METHOD=
PATIENT="${PATIENT:-}"
SAMPLE="${SAMPLE:-}"
DATE=`date +'%Y-%m-%dT%H:%M:%S'`
ID=`base64 /dev/urandom | tr --delete "/+=" | head --bytes=10`
DATE="${DATE:-$(date +'%Y-%m-%dT%H:%M:%S')}"
ID=$(base64 /dev/urandom | tr --delete "/+=" | head --bytes=10)
INVALIDATE=()
USE=()
REVISION_OF=


Loading…
Cancel
Save