mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Move env_file_to_json next to other helper functions
This commit is contained in:
parent
804010c88d
commit
32e1069d43
26
psu
26
psu
@ -1110,19 +1110,6 @@ login() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################################
|
|
||||||
# Convert environment variables from file to JSON #
|
|
||||||
# Globals: #
|
|
||||||
# ENVIRONMENT_VARIABLES_FILE #
|
|
||||||
# Arguments: #
|
|
||||||
# None #
|
|
||||||
# Returns: #
|
|
||||||
# JSON string #
|
|
||||||
###################################################
|
|
||||||
env_file_to_json() {
|
|
||||||
echo "$(env -i sh -c "(unset \$(env | sed 's/=.*//'); set -a; . $(readlink -f $ENVIRONMENT_VARIABLES_FILE); set +a; jq -njc 'env | to_entries | map({name: .key, value: .value})')")"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get Docker info
|
# Get Docker info
|
||||||
docker_info() {
|
docker_info() {
|
||||||
local docker_info
|
local docker_info
|
||||||
@ -1260,6 +1247,19 @@ lint() {
|
|||||||
fi || true
|
fi || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###################################################
|
||||||
|
# Convert environment variables from file to JSON #
|
||||||
|
# Globals: #
|
||||||
|
# ENVIRONMENT_VARIABLES_FILE #
|
||||||
|
# Arguments: #
|
||||||
|
# None #
|
||||||
|
# Returns: #
|
||||||
|
# JSON string #
|
||||||
|
###################################################
|
||||||
|
env_file_to_json() {
|
||||||
|
echo "$(env -i sh -c "(unset \$(env | sed 's/=.*//'); set -a; . $(readlink -f $ENVIRONMENT_VARIABLES_FILE); set +a; jq -njc 'env | to_entries | map({name: .key, value: .value})')")"
|
||||||
|
}
|
||||||
|
|
||||||
# Set the ACTIONS variable who's a list of all psu actions
|
# Set the ACTIONS variable who's a list of all psu actions
|
||||||
# Set the ACTIONS_ASSOC variable who's an associative array of all psu actions
|
# Set the ACTIONS_ASSOC variable who's an associative array of all psu actions
|
||||||
transform_actions_table() {
|
transform_actions_table() {
|
||||||
|
Loading…
Reference in New Issue
Block a user