[script_manager] converted dt.print_log statements to log.msg with the appropriate level
This commit is contained in:
@@ -203,14 +203,14 @@ local function get_repo_status(repo)
|
|||||||
p:close()
|
p:close()
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
dt.print_error("unable to get status of " .. repo)
|
log.msg(log.error, "unable to get status of " .. repo)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_current_repo_branch(repo_data)
|
local function get_current_repo_branch(repo_data)
|
||||||
local branch = nil
|
local branch = nil
|
||||||
branch = string.match(repo_data, "On branch (.-)\n")
|
branch = string.match(repo_data, "On branch (.-)\n")
|
||||||
dt.print_log("\ncurrent rep branch is " .. branch)
|
log.msg(log.info, "\ncurrent rep0 branch is " .. branch)
|
||||||
return branch
|
return branch
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -220,13 +220,13 @@ local function get_repo_branches(repo)
|
|||||||
if p then
|
if p then
|
||||||
local data = p:read("*a")
|
local data = p:read("*a")
|
||||||
p:close()
|
p:close()
|
||||||
dt.print_log("data is \n" .. data)
|
log.msg(log.debug, "data is \n" .. data)
|
||||||
local branch_data = du.split(data, "\n")
|
local branch_data = du.split(data, "\n")
|
||||||
for _, line in ipairs(branch_data) do
|
for _, line in ipairs(branch_data) do
|
||||||
dt.print_log("line is " .. line)
|
log.msg(log.debug, "line is " .. line)
|
||||||
local branch = string.gsub(line, "%s+remotes/%a+/", "")
|
local branch = string.gsub(line, "%s+remotes/%a+/", "")
|
||||||
if string.match(branch, "API") then
|
if string.match(branch, "API") then
|
||||||
dt.print_log("found branch - " .. branch)
|
log.msg(log.info, "found branch - " .. branch)
|
||||||
table.insert(branches, branch)
|
table.insert(branches, branch)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -237,16 +237,16 @@ end
|
|||||||
|
|
||||||
local function is_repo_clean(repo_data)
|
local function is_repo_clean(repo_data)
|
||||||
if string.match(repo_data, "working tree clean") then
|
if string.match(repo_data, "working tree clean") then
|
||||||
dt.print_log("repo is clean")
|
log.msg(log.info, "repo is clean")
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
dt.print_log("repo is dirty")
|
log.msg(log.info, "repo is dirty")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function checkout_repo_branch(repo, branch)
|
local function checkout_repo_branch(repo, branch)
|
||||||
dt.print_log("checkout out branch " .. branch .. " from repository " .. repo)
|
log.msg(log.info, "checkout out branch " .. branch .. " from repository " .. repo)
|
||||||
os.execute("cd " .. repo .. CS .. "git checkout " .. branch)
|
os.execute("cd " .. repo .. CS .. "git checkout " .. branch)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ local function update_scripts()
|
|||||||
local git = sm.executables.git
|
local git = sm.executables.git
|
||||||
|
|
||||||
if not git then
|
if not git then
|
||||||
dt.print("ERROR: git not found. Install or specify the location of the git executable.")
|
dt.print(_("ERROR: git not found. Install or specify the location of the git executable."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@ local function install_scripts()
|
|||||||
local git = sm.executables.git
|
local git = sm.executables.git
|
||||||
|
|
||||||
if not git then
|
if not git then
|
||||||
dt.print("ERROR: git not found. Install or specify the location of the git executable.")
|
dt.print(_("ERROR: git not found. Install or specify the location of the git executable."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user