-
-
Save tjschuck/0e49f912f7dd197fe950 to your computer and use it in GitHub Desktop.
This file contains 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
diff --git a/bootstrap.sh b/bootstrap.sh | |
index 5cacd2d..62bfce3 100644 | |
--- a/bootstrap.sh | |
+++ b/bootstrap.sh | |
@@ -3,6 +3,7 @@ | |
set -e | |
as_vagrant='sudo -u vagrant -H bash -l -c' | |
+home='/home/vagrant' | |
apt-get -y update | |
apt-get install -y curl git-core mingw32 default-jdk | |
@@ -13,19 +14,22 @@ mingw64='x86_64-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz' | |
$as_vagrant 'mkdir -p ~/mingw' | |
-if [ ! -f $mingw32 ]; then | |
+if [ ! -f "$home/mingw/$mingw32" ]; then | |
$as_vagrant "curl -L http://downloads.sourceforge.net/mingw-w64/$mingw32 -o ~/mingw/$mingw32" | |
$as_vagrant "tar -C ~/mingw -xf ~/mingw/$mingw32" | |
fi | |
-if [ ! -f $mingw64 ]; then | |
+if [ ! -f "$home/mingw/$mingw64" ]; then | |
$as_vagrant "curl -L http://downloads.sourceforge.net/mingw-w64/$mingw64 -o ~/mingw/$mingw64" | |
$as_vagrant "tar -C ~/mingw -xf ~/mingw/$mingw64" | |
fi | |
# add mingw-w64 to the PATH | |
-# TODO: do not add if already added | |
-$as_vagrant 'echo "export PATH=$PATH:$HOME/mingw/mingw32/bin:$HOME/mingw/mingw64/bin" >> ~/.bash_profile' | |
+mingw_w64_paths="$home/mingw/mingw32/bin:$home/mingw/mingw64/bin" | |
+ | |
+if ! grep -q $mingw_w64_paths $home/.bash_profile; then | |
+ echo "export PATH=\$PATH:$mingw_w64_paths" >> $home/.bash_profile | |
+fi | |
# do not generate documentation for gems |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment