-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
- IFS manipulation did not appear to be doing anything helpful, so I removed it. - Linking files with a newline is not actually fixed, but the behavior did change slightly, so I updated the test.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,13 @@ function symlink { | |
ignore 'ignored' "$castle" | ||
return $EX_SUCCESS | ||
fi | ||
oldIFS=$IFS | ||
IFS=$'\n' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dougborg
Author
Contributor
|
||
for filename in $(get_repo_files $repo/home); do | ||
for filename in $(get_repo_files "$repo/home"); do | ||
remote="$repo/home/$filename" | ||
IFS=$oldIFS | ||
local=$HOME/$filename | ||
local="$HOME/$filename" | ||
|
||
if [[ -e $local || -L $local ]]; then | ||
# $local exists (but may be a dead symlink) | ||
if [[ -L $local && $(readlink "$local") == $remote ]]; then | ||
if [[ -L $local && $(readlink "$local") == "$remote" ]]; then | ||
# $local symlinks to $remote. | ||
if [[ -d $remote && ! -L $remote ]]; then | ||
# If $remote is a directory -> legacy handling. | ||
|
Hehe, yeah. Turns out the IFS change actually had a purpose (#123). It's my fault, I should've checked the PR more closely and most of all not refactored out the code that tested this, when I moved the testing framework to bats.