[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Use io.popen (173f97f)

Marcel Fabian Krüger tex at 2krueger.de
Mon Aug 26 23:22:18 CEST 2019


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/173f97f584acf3c43061d260b4d60ac719000264

>---------------------------------------------------------------

commit 173f97f584acf3c43061d260b4d60ac719000264
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Mon Aug 26 23:22:18 2019 +0200

    Use io.popen


>---------------------------------------------------------------

173f97f584acf3c43061d260b4d60ac719000264
 build.lua | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/build.lua b/build.lua
index cd5f4c9..15f0787 100644
--- a/build.lua
+++ b/build.lua
@@ -19,16 +19,12 @@ print(mydata.email)
 
 --------- setup things for a dev-version
 -- See stackoverflow.com/a/12142066/212001 / build-config from latex2e
-local errorlevel = os.execute("git rev-parse --abbrev-ref HEAD > branch.tmp")
 local master_branch = true
-if errorlevel ~= 0 then
-  exit(1)
-else
- local f = assert(io.open("branch.tmp", "rb"))
- local branch = f:read("*all")
- f:close()
- os.remove("branch.tmp")
- if  string.match(branch, "dev") then
+do
+ local f = io.popen'git rev-parse --abbrev-ref HEAD'
+ local branch = f:read'*a':sub(1,-2)
+ assert(f:close())
+ if string.match(branch, "dev") then
     master_branch = false
     tdsroot = "latex-dev"
     print("creating/installing dev-version in " .. tdsroot)





More information about the latex3-commits mailing list