Skip to content

Commit

Permalink
Merge pull request #524 from YunoHost/add_ynh_delete_file_checksum
Browse files Browse the repository at this point in the history
Add ynh_delete_file_checksum
  • Loading branch information
Psycojoker committed Oct 3, 2018
2 parents f6780ae + 7f7fb80 commit cedaaa9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions data/helpers.d/filesystem
Expand Up @@ -299,6 +299,23 @@ ynh_backup_if_checksum_is_different () {
fi
}

# Delete a file checksum from the app settings
#
# $app should be defined when calling this helper
#
# usage: ynh_remove_file_checksum file
# | arg: -f, --file= - The file for which the checksum will be deleted
ynh_delete_file_checksum () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [f]=file= )
local file
# Manage arguments with getopts
ynh_handle_getopts_args "$@"

local checksum_setting_name=checksum_${file//[\/ ]/_} # Replace all '/' and ' ' by '_'
ynh_app_setting_delete $app $checksum_setting_name
}

# Remove a file or a directory securely
#
# usage: ynh_secure_remove path_to_remove
Expand Down

0 comments on commit cedaaa9

Please sign in to comment.