Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from VividCortex/improved_comments_fix
Browse files Browse the repository at this point in the history
Improved comments fix
  • Loading branch information
pote committed Aug 8, 2013
2 parents 656b6bb + a091fe5 commit 8c378b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 3 additions & 4 deletions bin/johnny_deps
Original file line number Diff line number Diff line change
Expand Up @@ -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")
10 changes: 7 additions & 3 deletions test/commented_lines_are_ignored_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
# A comment here...
github.com/nu7hatch/gotrail v0.0.2
github.com/pote/johnny-deps-testing-package v5.0 # a comment there!
# github.com/pote/johnny-deps-testing-package v5.1
EOF

../bin/johnny_deps
assert "go run go_code.go" "v5.0"
Expand Down

0 comments on commit 8c378b8

Please sign in to comment.