Skip to content

Commit 67dba09

Browse files
committed
step version v2.2
1 parent 59674df commit 67dba09

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

build.lua

+11-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ end
4343
require('build-private.lua')
4444

4545
function tag_hook(tagname)
46+
-- fail if tagname is missing
47+
if not tagname then
48+
print("No tagname provided, please use 'l3build tag <tagname>'")
49+
return
50+
end
51+
-- fail if tag already exists locally
52+
if os.execute("git rev-parse " .. tagname) == 0 then
53+
print("Tag '" .. tagname .. "' already exists locally")
54+
return
55+
end
4656
-- update the tag first
4757
for _, file in ipairs(tagfiles) do
4858
for _, file in ipairs(filelist(file)) do
@@ -60,7 +70,7 @@ function tag_hook(tagname)
6070
print("Press any key to continue...")
6171
io.read()
6272

63-
git("commit -m 'step version " .. tagname .. "'")
73+
git("commit -S -m 'step version " .. tagname .. "'")
6474
git("tag", tagname)
6575
git("push", "--tags")
6676
git("push")

0 commit comments

Comments
 (0)