-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates for a faster link command. #119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,16 +102,16 @@ EOF | |
castle 'dotfiles' | ||
mkdir -p $HOME/.config/bar.dir | ||
cat > $HOME/.config/foo.conf <<EOF | ||
#I am just a regular foo.conf file | ||
#I am just a regular foo.conf file | ||
[foo] | ||
A=True | ||
EOF | ||
cat > $HOME/.config/bar.dir/bar.conf <<EOF | ||
#I am just a regular bar.conf file | ||
#I am just a regular bar.conf file | ||
[bar] | ||
A=True | ||
EOF | ||
|
||
[ -f "$HOME/.config/foo.conf" ] | ||
#.config/foo.conf should be overwritten by a directory of the same name | ||
[ -d "$HOME/.config/bar.dir" ] | ||
|
@@ -161,14 +161,13 @@ EOF | |
|
||
@test 'fail when linking file with newline' { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I stated earlier, I wasn't able to actually get files with newlines working, but the behavior changed enough to fail the existing test. On the plus side, if you DO try to link a file with a newline, you end up with a single link rather than 2, but in the process the file name is mangled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's actually way better behavior 👍 |
||
castle 'rc-files' | ||
touch "$HOMESICK/repos/rc-files/home/filename | ||
test_filename="filename | ||
newline" | ||
touch "$HOMESICK/repos/rc-files/home/$test_filename" | ||
commit_repo_state $HOMESICK/repos/rc-files | ||
$HOMESHICK_FN --batch link rc-files | ||
[ -L "$HOME/\"filename" ] | ||
[ -L "$HOME/newline\"" ] | ||
is_symlink $HOMESICK/repos/rc-files/home/\"filename $HOME/\"filename | ||
is_symlink $HOMESICK/repos/rc-files/home/newline\" $HOME/newline\" | ||
[ -L "$HOME/\"filenamennewline\"" ] | ||
is_symlink "$HOMESICK/repos/rc-files/home/\"filenamennewline\"" "$HOME/\"filenamennewline\"" | ||
} | ||
|
||
@test 'files ignored by git should not be linked' { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be good to consider logging everything in homeshick to
stderr
instead of most things tostdout
, and only errors tostderr
(from what I remember of my brief look atlog.sh
, I think that is the current behavior). Logging to stderr in bash scripts enables you to log things without pollutingstdout
, which often gets piped around or evaluated by other functions. I would be happy to do the work if you feel like it is a good idea as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and this line along with the success line at the end of the function lets the user know an operation is happening so impatient fools (like myself) are less likely to CTRL-C after a few seconds because it looks like nothing is happening 😄.
BTW, I really like the way you have done your logging with the
pending
/success
functions - it looks really slick.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think anything other than progress should be logged to
stdout
, it should be machine-readable however (I created #70 a long time ago to track progress on that, still haven't gotten around to it :-)).Thanks! It was fun to code as well, hehe.