@@ -26,29 +26,28 @@ if [[ -n "${CODER_FORCE_VERSION:-}" ]]; then
26
26
exit 0
27
27
fi
28
28
29
-
30
29
# To make contributing easier, if there are no tags, we'll use a default
31
30
# version.
32
31
tag_list=$( git tag)
33
32
if [[ -z ${tag_list} ]]; then
34
- log
35
- log " INFO(version.sh): It appears you've checked out a fork or shallow clone of Coder."
36
- log " INFO(version.sh): By default GitHub does not include tags when forking."
37
- log " INFO(version.sh): We will use the default version 2.0.0 for this build."
38
- log " INFO(version.sh): To pull tags from upstream, use the following commands:"
39
- log " INFO(version.sh): - git remote add upstream https://github.com/coder/coder.git"
40
- log " INFO(version.sh): - git fetch upstream"
41
- log
42
- last_tag=" v2.0.0"
33
+ log
34
+ log " INFO(version.sh): It appears you've checked out a fork or shallow clone of Coder."
35
+ log " INFO(version.sh): By default GitHub does not include tags when forking."
36
+ log " INFO(version.sh): We will use the default version 2.0.0 for this build."
37
+ log " INFO(version.sh): To pull tags from upstream, use the following commands:"
38
+ log " INFO(version.sh): - git remote add upstream https://github.com/coder/coder.git"
39
+ log " INFO(version.sh): - git fetch upstream"
40
+ log
41
+ last_tag=" v2.0.0"
43
42
else
44
- current_commit=$( git rev-parse HEAD)
45
- # Try to find the last tag that contains the current commit
46
- last_tag=$( git tag --contains " $current_commit " --sort=version:refname | head -n 1)
47
- # If there is no tag that contains the current commit,
48
- # get the latest tag sorted by semver.
49
- if [[ -z " ${last_tag} " ]]; then
50
- last_tag=$( git tag --sort=version:refname | tail -n 1)
51
- fi
43
+ current_commit=$( git rev-parse HEAD)
44
+ # Try to find the last tag that contains the current commit
45
+ last_tag=$( git tag --contains " $current_commit " --sort=version:refname | head -n 1)
46
+ # If there is no tag that contains the current commit,
47
+ # get the latest tag sorted by semver.
48
+ if [[ -z " ${last_tag} " ]]; then
49
+ last_tag=$( git tag --sort=version:refname | tail -n 1)
50
+ fi
52
51
fi
53
52
54
53
version=" ${last_tag} "
0 commit comments