Skip to content
Browse files

Remove Rakefile and replace it with install bash file

  • Loading branch information...
1 parent d344487 commit e372dcfe0f6006c538bc36e4dd7195bb8a035884 Jamal El Milahi committed Mar 11, 2012
Showing with 24 additions and 21 deletions.
  1. +1 −1 README.rdoc
  2. +0 −20 Rakefile
  3. +23 −0 install
View
2 README.rdoc
@@ -8,4 +8,4 @@ You need to have Macvim[http://code.google.com/p/macvim/], Janus[https://github.
$ git clone git://github.com/bloc40/dotfiles.git
$ cd dotfiles
- $ rake install
+ $ ./install
View
20 Rakefile
@@ -1,20 +0,0 @@
-require 'rake'
-
-desc 'Install the dot files into the home directory'
-task :install do
- EXCLUDED_FILES = %w[ . .. .git .gitmodules Rakefile README.rdoc ]
-
- home_directory_files = []
- Dir.foreach(ENV['HOME']) { |f| home_directory_files << f }
-
- Dir.foreach(ENV['PWD']).each do |file|
- next if EXCLUDED_FILES.include?(file)
-
- if home_directory_files.include?(file)
- puts "Skipping ~/#{file}. It exists already"
- else
- puts "Linking ~/#{file}"
- system %Q{ln -s $PWD/#{file} $HOME/#{file}}
- end
- end
-end
View
23 install
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+EXCLUDED_FILES=( README.rdoc .git .gitmodules 'install' )
+
+for file in $(ls -A $pwd ); do
+ target=`echo ${EXCLUDED_FILES[*]} | grep $file`
+
+ if [ "${target}" == "" ]; then
+ if [[ -e ~/$file ]]; then
+ if [ ! -L ~/$file ]; then
+ echo "$file exists but not a symlink"
+ echo "Moving $file to $file.bak"
+ mv $HOME/$file "$HOME/$file.bak"
+ echo "Symlinking $file ..."
+ ln -s $PWD/$file $HOME/$file
+ fi
+ else
+ echo "Symlinking $file ..."
+ ln -s $PWD/$file $HOME/$file
+ fi
+ fi
+done
+

0 comments on commit e372dcf

Please sign in to comment.
Something went wrong with that request. Please try again.