From 172396583ffb42d0e069f5c8572c1af5751f6b9f Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Wed, 19 Jun 2024 13:35:38 -0400 Subject: [PATCH] Fix symlink command on Linux --- dotfiles/script_helpers/file_ops.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dotfiles/script_helpers/file_ops.sh b/dotfiles/script_helpers/file_ops.sh index 5094560..e82b8e7 100644 --- a/dotfiles/script_helpers/file_ops.sh +++ b/dotfiles/script_helpers/file_ops.sh @@ -190,7 +190,7 @@ expand_unix_path_if_not_symlink_or_absolute() { echo $path } -# Moves a single file. Optionally provide a new file name as a third param. +# Moves a single file. Optionally provide a new file name as a third param. move_file() { local src="$1" local src_expanded=$(expand_path "$src") @@ -216,7 +216,7 @@ move_file() { fi } -# Copies a single file. Optionally provide a new file name as a third param. +# Copies a single file. Optionally provide a new file name as a third param. # If you want to copy all files with a specific extension then use copy_dir_files. copy_file() { local src="$1" @@ -375,6 +375,8 @@ make_link() { if [[ $dest_has_space -eq 1 ]]; then cmd_dest_path="\"$cmd_dest_path\""; fi link_cmd="cmd //c 'mklink $cmd_dest_path $cmd_source_path'" else + cmd_source_path="$final_src" + cmd_dest_path="$final_dest" if [[ $source_has_space -eq 1 ]]; then cmd_source_path="\"$cmd_source_path\""; fi if [[ $dest_has_space -eq 1 ]]; then cmd_dest_path="\"$cmd_dest_path\""; fi link_cmd="ln -sf $cmd_source_path $cmd_dest_path"