diff options
author | erw7 <erw7.github@gmail.com> | 2019-11-02 04:54:59 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-11-02 04:54:59 +0900 |
commit | 90981f5861e4c23c6a23a0082261b074ba48ea47 (patch) | |
tree | aff2f2a12e45d8b61ecd31a7904dd3bf748f93fb /scripts/update_version_stamp.lua | |
parent | 471427d045f74fa9d2e47b2975ef178e719c2ae8 (diff) | |
download | rneovim-90981f5861e4c23c6a23a0082261b074ba48ea47.tar.gz rneovim-90981f5861e4c23c6a23a0082261b074ba48ea47.tar.bz2 rneovim-90981f5861e4c23c6a23a0082261b074ba48ea47.zip |
update_version_stamp.lua: Use NUL on Windows #11323
Diffstat (limited to 'scripts/update_version_stamp.lua')
-rwxr-xr-x | scripts/update_version_stamp.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/update_version_stamp.lua b/scripts/update_version_stamp.lua index 394c4f7694..11b521fab6 100755 --- a/scripts/update_version_stamp.lua +++ b/scripts/update_version_stamp.lua @@ -13,6 +13,10 @@ local function die(msg) os.exit(0) end +local function iswin() + return package.config:sub(1,1) == '\\' +end + if #arg ~= 2 then die(string.format("Expected two args, got %d", #arg)) end @@ -20,7 +24,8 @@ end local versiondeffile = arg[1] 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 described = io.popen('git describe --first-parent --tags --always --dirty'):read('*l') end |