Created
August 14, 2013 22:20
-
-
Save raymondfeng/6236245 to your computer and use it in GitHub Desktop.
Uninstaller for StrongLoop Node 1.1.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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