replace install with a simple shell script (remove ruby dependency)
This commit is contained in:
parent
efb4b24cbf
commit
d2e16b6b6b
18
install.rb
18
install.rb
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# from http://errtheblog.com/posts/89-huba-huba
|
||||
|
||||
home = File.expand_path('~')
|
||||
|
||||
Dir['*'].each do |file|
|
||||
next if file =~ /install/ || file =~ /README/
|
||||
target_name = file == 'bin' ? file : ".#{file}"
|
||||
target = File.join(home, target_name)
|
||||
unless File.exist? target
|
||||
`ln -vsf #{File.expand_path file} #{target}`
|
||||
else
|
||||
unless File.symlink? target
|
||||
puts "#{target} exists"
|
||||
end
|
||||
end
|
||||
end
|
20
install.sh
Executable file
20
install.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
DOTFILES=`cd $(dirname $0); pwd`
|
||||
|
||||
for FILE in $DOTFILES/*; do
|
||||
NAME=`basename $FILE`
|
||||
if [ $NAME == 'bin' ]; then
|
||||
TARGET=$HOME/bin
|
||||
else
|
||||
TARGET=$HOME/.$NAME
|
||||
fi
|
||||
|
||||
if [ $NAME != 'install.sh' ]; then
|
||||
if [ -L $TARGET ]; then
|
||||
echo "$TARGET exists"
|
||||
else
|
||||
ln -vsf $FILE $TARGET
|
||||
fi
|
||||
fi
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user