Created
March 23, 2013 21:18
-
-
Save ngsw/5229392 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| ##(snip) | |
| # Appends a value to an array. | |
| # | |
| # @param [String] $1 Name of the variable to modify | |
| # @param [String] $2 Value to append | |
| function append() { | |
| eval $1[\${#$1[*]}]=$2 | |
| } | |
| #---------------------------------------------------------------------- | |
| # Script | |
| #---------------------------------------------------------------------- | |
| # Collect the directories and files to remove | |
| my_files=() | |
| append my_files "/Applications/Vagrant" | |
| append my_files "/usr/bin/vagrant" | |
| # Print the files and directories that are to be removed and verify | |
| # with the user that that is what he/she really wants to do. | |
| echo "The following files and directories will be removed:" | |
| for file in "${my_files[@]}"; do | |
| echo " $file" | |
| done | |
| ##(snip) | |
| ## http://downloads.vagrantup.com/tags/v1.1.2 | |
| ## Mac :: Vagrant.dmg | |
| ## /Volumes/Vagrant/uninstall.tool |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考にする