mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
update_version_stamp.lua: Use NUL on Windows #11323
This commit is contained in:
parent
471427d045
commit
90981f5861
@ -13,6 +13,10 @@ local function die(msg)
|
|||||||
os.exit(0)
|
os.exit(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function iswin()
|
||||||
|
return package.config:sub(1,1) == '\\'
|
||||||
|
end
|
||||||
|
|
||||||
if #arg ~= 2 then
|
if #arg ~= 2 then
|
||||||
die(string.format("Expected two args, got %d", #arg))
|
die(string.format("Expected two args, got %d", #arg))
|
||||||
end
|
end
|
||||||
@ -20,7 +24,8 @@ end
|
|||||||
local versiondeffile = arg[1]
|
local versiondeffile = arg[1]
|
||||||
local prefix = arg[2]
|
local prefix = arg[2]
|
||||||
|
|
||||||
local described = io.popen('git describe --first-parent --dirty 2>/dev/null'):read('*l')
|
local dev_null = iswin() and 'NUL' or '/dev/null'
|
||||||
|
local described = io.popen('git describe --first-parent --dirty 2>'..dev_null):read('*l')
|
||||||
if not described then
|
if not described then
|
||||||
described = io.popen('git describe --first-parent --tags --always --dirty'):read('*l')
|
described = io.popen('git describe --first-parent --tags --always --dirty'):read('*l')
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user