Permalink
Browse files

Add a setup script to symlink _sh

  • Loading branch information...
1 parent b4903f1 commit 06784e2222bf577e7bd6bdff2873a2a5e4640c54 @evansolomon committed Aug 18, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 setup.py
View
@@ -0,0 +1,28 @@
+import os
+import sys
+
+# Welcome
+print "Welcome to _sh.\n"
+
+# Get the target location
+target = raw_input('Where do you want to symlink _sh? ')
+print "\n"
+
+# No blank targets
+if not target:
+ print 'You have to pick a target.'
+ sys.exit()
+
+# Make sure it exists
+target_dir = os.path.expanduser(target)
+if not os.path.exists(target_dir):
+ print target + ' is not a directory.'
+ sys.exit()
+
+# Make sure _sh is executable
+os.system('chmod u+x ' + os.path.realpath('_sh'))
+
+# Symlink it
+command = 'ln -s ' + os.path.realpath('_sh') + ' ' + target_dir
+print "\nRunning...\n\n" + command
+result = os.system(command)

0 comments on commit 06784e2

Please sign in to comment.