Allow to evaluate user env paths
@@ -76,6 +76,12 @@ for _ATTRIBUTE_NAME in $_OWNER_ATTRIBUTES_NAMES; do
# If it's a "redirection" string - the value will be stored in the file
_ATTRIBUTE_ENV_VALUE="${BASH_REMATCH[1]}"
_ATTRIBUTE_ENV_PATH="${BASH_REMATCH[2]}"
+
+ # Optional "eval" the path part, so we can use env vars or simple expressions
+ if [ "$CP_OWNER_ATTRIBUTES_EVAL_VALUE" == "true" ]; then
+ _ATTRIBUTE_ENV_PATH=$(eval "echo $_ATTRIBUTE_ENV_PATH")
+ fi
+
mkdir -p $(dirname $_ATTRIBUTE_ENV_PATH)
echo "$_ATTRIBUTE_ENV_VALUE" > "$_ATTRIBUTE_ENV_PATH"
if [ $? -ne 0 ]; then
