Skip to content

Instantly share code, notes, and snippets.

@raymondfeng
Created August 14, 2013 22:20
Show Gist options
  • Select an option

  • Save raymondfeng/6236245 to your computer and use it in GitHub Desktop.

Select an option

Save raymondfeng/6236245 to your computer and use it in GitHub Desktop.
Uninstaller for StrongLoop Node 1.1.x
#!/bin/sh
(( ${#} > 0 )) || {
echo 'StrongLoop Node Uninstall script based on original script courtesy of Nice Robot Co.'
echo 'Press Control-C to quit now.'
read
echo 'Re-running the script with sudo.'
echo 'You may be prompted for a password.'
sudo ${0} sudo
exit $?
}
# This will need to be executed as an Admin (maybe just use sudo).
# Verify the bom exists, otherwise don't do anything
[ -e /var/db/receipts/org.nodejs.pkg.bom ] || {
echo 'Nothing to do.'
exit 0
}
# Loop through all the files in the bom for community node
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \
| while read i; do
# Remove each file listed in the bom.
rm /usr/local/${i}
done
# Loop through all the files in the bom for strongloop
lsbom -f -l -s -pf /var/db/receipts/com.strongloop.node.sample-blog.pkg.bom \
| while read i; do
# Remove each file listed in the bom.
rm /usr/local/share/strongloop-node/sample-apps/sample-blog/${i}
done
lsbom -f -l -s -pf /var/db/receipts/com.strongloop.node.docs.pkg.bom \
| while read i; do
# Remove each file listed in the bom.
rm /usr/local/share/strongloop-node/docs/${i}
done
# Remove directories related to node.js and strongloop.
rm -rf /usr/local/lib/node \
/usr/local/lib/node_modules \
/usr/local/share/strongloop-node \
/var/db/receipts/org.nodejs.* \
/var/db/receipts/com.strongloop.* \
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment