Skip to content

Commit

Permalink
add some feedback and conditional append bin to zshrc
Browse files Browse the repository at this point in the history
  • Loading branch information
thepeterstone committed Feb 17, 2012
1 parent 3eb3bdb commit a337763
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/home-sync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/zsh

# We're located in bin/
ROOT=$(cd $(dirname $(dirname $0)); pwd)
Expand All @@ -7,8 +7,14 @@ main() {
rm -rf $ROOT/backups; mkdir $ROOT/backups

for file in $(ls $ROOT/dot-files); do
echo "Updating $file..."
backupAndReplace $file
done

if [ -z "$(grep 'added by home-sync' ~/.zshrc)" ]; then
echo "export PATH=\"\$PATH:$ROOT/bin\" # added by home-sync" >> ~/.zshrc
echo "~/.zsrhc updated - source it to apply changes."
fi
}

backupAndReplace() {
Expand Down

0 comments on commit a337763

Please sign in to comment.