Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 29 lines (22 sloc) 0.619 kb
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.'
# Make sure it exists
target_dir = os.path.expanduser(target)
if not os.path.exists(target_dir):
print target + ' is not a directory.'
# 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)
Jump to Line
Something went wrong with that request. Please try again.