We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36594e5 commit 6a19fdeCopy full SHA for 6a19fde
commands/init
@@ -21,6 +21,9 @@ if [ -z "$VERSION" ]; then
21
VERSION="$(git symbolic-ref --short HEAD)"
22
fi
23
24
+if [ -z "$VERSION" ] && [ -n "$TRAVIS_BRANCH" ]; then
25
+ VERSION="$TRAVIS_BRANCH"
26
+fi
27
if [ -z "$VERSION" ]; then
28
VERSION="v1"
29
@@ -46,8 +49,10 @@ if [ ! -e .git ] || [ -z "$NAME" ] || [ -z "$VERSION" ]; then
46
49
git init
47
50
48
51
-if [ "$(git symbolic-ref --short HEAD)" != "$VERSION" ]; then
- git checkout -b "$VERSION"
52
+if git symbolic-ref --short HEAD > /dev/null 2>&1; then
53
+ if [ "$(git symbolic-ref --short HEAD)" != "$VERSION" ]; then
54
+ git checkout -b "$VERSION"
55
+ fi
56
57
58
if [ -n "$TRAVIS_BRANCH" ]; then
0 commit comments