Browse files

Made the packager relative to the cwd. Added rm command to remove exi…

…sting .box for building a new one.
  • Loading branch information...
1 parent 67f6745 commit 51d7bd5a55ec8b1e96d4d07eca33085f8d064193 @manarth committed May 18, 2012
Showing with 14 additions and 3 deletions.
  1. +14 −3 package.sh
View
17 package.sh
@@ -4,14 +4,25 @@
# Base box.
base="ProjectOscar_1337284846"
+# Path to the directory of this script.
+cwd="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
# Path to the .box file.
-# TODO: make this relative to this package.sh script.
-filepath="~/Development/ProjectOscar/packages"
+filepath="$cwd/packages"
# Filename for the .box file
filename="project_oscar.box"
boxfile="$filepath/$filename"
+# Remove the old box, if it exists.
+if [ -f $boxfile ]
+ then
+ echo "Removing old boxfile."
+ rm $boxfile
+fi
+
+echo "Packaging $boxfile."
+
# Package that box.
-vagrant package --base $base --output $boxfile --vagrantfile Vagrantfile --include README.md,puppet/
+vagrant package --base $base --output $boxfile --vagrantfile Vagrantfile --include puppet/

0 comments on commit 51d7bd5

Please sign in to comment.