[enh] Support __FINALPATH__ in file source

This commit is contained in:
ljf 2021-08-20 18:02:54 +02:00
parent 2ac4e1c5bf
commit b79d5ae416

View file

@ -132,7 +132,7 @@ EOL
elif [[ "$source" == *":"* ]] ; then
local source_key="$(echo "$source" | cut -d: -f1)"
source_key=${source_key:-$short_setting}
local source_file="$(echo "$source" | cut -d: -f2)"
local source_file="$(echo "$source" | cut -d: -f2 | sed s@__FINALPATH__@$final_path@ | sed s/__APP__/$app/)"
old[$short_setting]="$(ynh_value_get --file="${source_file}" --key="${source_key}")"
# Specific case for files (all content of the file is the source)