A package.json install that works.
It's an ugly hack, but it works.
This commit is contained in:
23
uninstall.sh
Executable file
23
uninstall.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
has=$(cat ~/.bashrc | egrep "^# ADDED BY npm FOR NVM$" || true)
|
||||
if [ "x$has" == "x" ]; then
|
||||
echo "doesn't have it, exiting"
|
||||
exit 0
|
||||
fi
|
||||
tmp=~/.bashrc.tmp
|
||||
cat ~/.bashrc | {
|
||||
incode=0
|
||||
while read line; do
|
||||
if [ "$line" == "# ADDED BY npm FOR NVM" ]; then
|
||||
incode=1
|
||||
elif [ "$line" == "# END ADDED BY npm FOR NVM" ] \
|
||||
&& [ $incode -eq 1 ]; then
|
||||
incode=0
|
||||
elif [ $incode -eq 0 ]; then
|
||||
echo "$line" >> $tmp
|
||||
fi
|
||||
done
|
||||
}
|
||||
mv $tmp ~/.bashrc
|
||||
Reference in New Issue
Block a user