From df6de5beab369ff03d85ba1c85becddb9b0dfb92 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 19 Jun 2013 22:44:02 -0700 Subject: [PATCH] move scripts into the scripts/ folder --- Makefile | 2 +- build.sh => scripts/build.sh | 7 +++++++ dist.sh => scripts/dist.sh | 9 +++++---- 3 files changed, 13 insertions(+), 5 deletions(-) rename build.sh => scripts/build.sh (67%) rename dist.sh => scripts/dist.sh (87%) mode change 100755 => 100644 diff --git a/Makefile b/Makefile index 97a5924b4..e9984fb6c 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ all: @echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)" @go get -d -v ./... @echo "$(OK_COLOR)==> Building$(NO_COLOR)" - @./build.sh + @./scripts/build.sh format: go fmt ./... diff --git a/build.sh b/scripts/build.sh similarity index 67% rename from build.sh rename to scripts/build.sh index 8c49964ea..280431698 100755 --- a/build.sh +++ b/scripts/build.sh @@ -6,6 +6,13 @@ OK_COLOR="\x1b[32;01m" ERROR_COLOR="\x1b[31;01m" WARN_COLOR="\x1b[33;01m" +# Get the parent directory of where this script is. +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" + +# Change into that directory +cd $DIR # Compile the main Packer app echo "${OK_COLOR}--> Compiling Packer${NO_COLOR}" diff --git a/dist.sh b/scripts/dist.sh old mode 100755 new mode 100644 similarity index 87% rename from dist.sh rename to scripts/dist.sh index ae245b922..a6b8f8ff4 --- a/dist.sh +++ b/scripts/dist.sh @@ -1,12 +1,13 @@ #!/bin/bash set -e -# Get the directory where this script is. This will also resolve -# any symlinks in the directory/script, so it will be the fully -# resolved path. +# Get the parent directory of where this script is. SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" + +# Change into that dir because we expect that +cd $DIR # Determine the version that we're building based on the contents # of packer/version.go.