Skip to content

Commit

Permalink
Fix branch commit parser in premake scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisant996 committed Feb 7, 2021
1 parent 1550042 commit 1d9b453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ local to = ".build/"..(_ACTION or "nullaction")
local function get_git_info()
local git_cmd = "git branch --verbose --no-color 2>nul"
for line in io.popen(git_cmd):lines() do
local _, _, name, commit = line:find("^%*.+%s+([^ )]+)%)%s+([a-f0-9]+)")
local _, _, name, commit = line:find("^%*.+%s+([^ )]+)%)%s+([a-f0-9]+)%s")
if name and commit then
return name, commit:sub(1, 6)
end

local _, _, name, commit = line:find("^%*%s+([^ ]+)%s+([a-f0-9]+)")
local _, _, name, commit = line:find("^%*%s+([^ ]+)%s+([a-f0-9]+)%s")
if name and commit then
return name, commit:sub(1, 6)
end
Expand Down

0 comments on commit 1d9b453

Please sign in to comment.