diff --git a/bin/johnny_deps b/bin/johnny_deps index bbc7534..0f1168b 100755 --- a/bin/johnny_deps +++ b/bin/johnny_deps @@ -11,19 +11,18 @@ set -eu root=$PWD godeps=${1-"Godeps"} +deps=$(sed 's/#.*//;/^\s*$/d' < "$godeps") while read package version; do - [[ -z "$package" || "$package" =~ ^# ]] && continue go get -v -u -d "$package" echo "Setting $package to version $version" cd "${GOPATH%%:*}/src/${package%%/...}" git checkout "$version" -done < "$godeps" +done < <(echo "$deps") cd "$root" while read package version; do - [[ -z "$package" || "$package" =~ ^# ]] && continue echo "Installing $package" go install "$package" -done < "$godeps" +done < <(echo "$deps") diff --git a/test/commented_lines_are_ignored_test.sh b/test/commented_lines_are_ignored_test.sh index aec0ac9..021ed93 100755 --- a/test/commented_lines_are_ignored_test.sh +++ b/test/commented_lines_are_ignored_test.sh @@ -2,9 +2,13 @@ . assert.sh # Setting up v5.0 of package -echo "github.com/pote/johnny-deps-testing-package v5.0" > Godeps -echo "#github.com/pote/johnny-deps-testing-package v5.1" >> Godeps -echo "# github.com/pote/johnny-deps-testing-package v5.1" >> Godeps +cat > Godeps <