1
0
Fork 0

fix variable quoting

This commit is contained in:
Massaki Archambault 2021-04-10 16:25:14 -04:00
parent 24de2671df
commit 1b6e1e65e2
1 changed files with 7 additions and 7 deletions

View File

@ -75,12 +75,12 @@ make_link() {
# File exists, ask to delete # File exists, ask to delete
if [[ "$OPT_YES" ]]; then if [[ "$OPT_YES" ]]; then
rm -rf $home_f rm -rf "$home_f"
else else
while true; do while true; do
read -r -p "Override $2? [Y/n] " a read -r -p "Override $2? [Y/n] " a
if [[ "${a,,}" = "y" ]]; then if [[ "${a,,}" = "y" ]]; then
rm -r $home_f rm -r "$home_f"
break break
elif [[ "${a,,}" = "n" ]]; then elif [[ "${a,,}" = "n" ]]; then
echo "skipping..." echo "skipping..."
@ -90,13 +90,13 @@ make_link() {
fi fi
fi fi
mkdir -p "$(dirname $home_f)" &>/dev/null mkdir -p "$(dirname "$home_f")" &>/dev/null
if [[ -n "$OPT_COPY" ]]; then if [[ -n "$OPT_COPY" ]]; then
log + "Creating copy $repo_f > $home_f" log + "Creating copy $repo_f > $home_f"
cp -r $repo_f $home_f cp -r "$repo_f" "$home_f"
else else
log + "Creating symlink $repo_f > $home_f" log + "Creating symlink $repo_f > $home_f"
ln -s $repo_f $home_f ln -s "$repo_f" "$home_f"
fi fi
} }
@ -157,9 +157,9 @@ fi
for file_source in "files"; do for file_source in "files"; do
log "*" "Processing $file_source" log "*" "Processing $file_source"
for file_path in $(get_path "$file_source"); do while read file_path; do
make_link "$PWD/$file_source/$file_path" "$file_path" make_link "$PWD/$file_source/$file_path" "$file_path"
done done < <(get_path "$file_source")
done done
if [[ -f "./scripts/post-install.sh" && -z "$OPT_NOSCRIPT" ]]; then if [[ -f "./scripts/post-install.sh" && -z "$OPT_NOSCRIPT" ]]; then