config panel: fix file type returning weird value

This commit is contained in:
Alexandre Aubin 2021-09-06 21:32:52 +02:00
parent f2d0732825
commit 050185a0c2

View file

@ -21,7 +21,7 @@ for panel_name, panel in loaded_toml.items():
print(';'.join([
name,
param.get('type', 'string'),
param.get('bind', 'settings' if param.get('type', 'string') != 'file' else '')
param.get('bind', 'settings' if param.get('type', 'string') != 'file' else 'null')
]))
EOL
`
@ -51,7 +51,7 @@ EOL
then
ynh_die "File '${short_setting}' can't be stored in settings"
fi
old[$short_setting]="$(ls $(echo $bind | sed s@__FINALPATH__@$final_path@ | sed s/__APP__/$app/) 2> /dev/null || echo YNH_NULL)"
old[$short_setting]="$(ls "$(echo $bind | sed s@__FINALPATH__@$final_path@ | sed s/__APP__/$app/)" 2> /dev/null || echo YNH_NULL)"
file_hash[$short_setting]="true"
# Get multiline text from settings or from a full file