Skip to content

Commit

Permalink
globing
Browse files Browse the repository at this point in the history
  • Loading branch information
kRHYME7 committed Nov 17, 2024
1 parent 6387e8b commit 7eda316
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Scripts/Manage-Config
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ generate_config_list() { #* Check the content of a Directory and make a restore
# restore_directory is the Source directory for Configs
restore_directory="${1:-${CloneDir}/Configs}"
# echo "$restore_directory"
# shellcheck disable=SC2154
: >"${ctl_override}"
# Read the file line by line
while IFS= read -r line; do
Expand Down Expand Up @@ -134,7 +135,7 @@ generate_config_list() { #* Check the content of a Directory and make a restore
;;
esac
done
done <"$(dirname ${restore_directory})/Scripts/restore_cfg.lst"
done <"$(dirname "${restore_directory}")/Scripts/restore_cfg.lst"
}

# shellcheck disable=SC2120
Expand All @@ -145,14 +146,14 @@ generate_config_list() { #* Check the content of a Directory and make a restore
make_List() {
# enable_package md5sum
CloneDir=${1:-"${CloneDir}"}
[ ! -d ${CloneDir} ] && exit 0
[ ! -d "${CloneDir}" ] && exit 0

#? If the ctlFile is present and no reuse flag do this
if [ -e "${ctlFile}" ] && [[ $* != *"--reuse"* ]]; then
show_restore_list "${ctlFile}"
now_restore_cfg_hash="$(md5sum "${CloneDir}/Scripts/restore_cfg.lst" | cut -d' ' -f1)"

if [ "$now_restore_cfg_hash" != "$restore_cfg_hash" ]; then
if [ "$now_restore_cfg_hash" != "${restore_cfg_hash}" ]; then
generate_config_list "${CloneDir}/Configs"
print_prompt -g "\n\n\nNew Files has been added/removed!" "\nCreate a new control file to avoid conflicts!\n"
else
Expand Down

0 comments on commit 7eda316

Please sign in to comment.