Browse Source

Fixed outputof to redirect all standard streams.

Workaround until https://github.com/premake/premake-core/pull/428 is closed.
pull/621/head
Joao Matos 10 years ago
parent
commit
efcb812c6c
  1. 2
      build/scripts/Provision.lua
  2. 9
      build/scripts/Utils.lua

2
build/scripts/Provision.lua

@ -83,7 +83,7 @@ end @@ -83,7 +83,7 @@ end
function brew_install(pkg)
-- check if package is already installed
local res = os.outputof("brew ls --versions " .. pkg)
local res = outputof("brew ls --versions " .. pkg)
if string.is_empty(res) then
execute("brew install " .. pkg)
end

9
build/scripts/Utils.lua

@ -9,6 +9,13 @@ function cat(file) @@ -9,6 +9,13 @@ function cat(file)
return output
end
function outputof(cmd, quiet)
local file = assert(io.popen(cmd .. " 2>&1", "r"))
local output = file:read('*all')
file:close()
return output
end
function execute(cmd, quiet)
print(cmd)
if not quiet then
@ -69,7 +76,7 @@ end @@ -69,7 +76,7 @@ end
function git.rev_parse(dir, rev)
local cmd = "git -C " .. path.translate(dir, sep) .. " rev-parse " .. rev
return os.outputof(cmd)
return outputof(cmd)
end
function http.progress (total, curr)

Loading…
Cancel
Save