negonicrac (owner)

Fork Of

gist: 21650 by zvoase pyunlink.sh - remove a pyli...

Revisions

gist: 29843 Download_button fork
public
Public Clone URL: git://gist.github.com/29843.git
pyunlink.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
 
# If there is not already a SITE_PACKAGES environment variable, then get it
# from Python.
if [ ! -d $SITE_PACKAGES ]
then
SITE_PACKAGES=`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`
fi
 
# If given name is a symbolic link in $SITE_PACKAGES
if [ -h $SITE_PACKAGES/`basename $1` ]; then
    # Remove it
    rm -Rf $SITE_PACKAGES/`basename $1`
else
    # Signal an error.
    echo "Error: link `basename $1` not found."
    exit 1
fi