Commit d6f2065e authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Add gpb and uscan path to config object. Check value of 2 path

parent 6172b8eb
......@@ -19,6 +19,8 @@ type
ProgConf* = object
rootPath*: string
logPath*: string
uscanPath*: string
gbpPath*: string
gitUrl*: string
devName*: string
devMail*: string
......@@ -57,8 +59,22 @@ proc initConfig*(config: var ProgConf): bool =
gbpPath = conf["gbp_path"].getStr()
uscanPath = conf["uscan_path"].getStr()
# Check value of gbp path
if isEmptyOrWhitespace(gbpPath):
mainLog.log(lvlInfo, "gbp path is empty! Use default value.")
config.gbpPath = "/usr/bin/gbp"
else:
config.gbpPath = gbpPath
# Check value of uscan path
if isEmptyOrWhitespace(uscanPath):
mainLog.log(lvlInfo, "uscan path is empty! Use default value.")
config.uscanPath = "/usr/bin/gbp"
else:
config.uscanPath = uscanPath
# Check if gbp and uscan is available
if not checkPrograms(gbpPath, uscanPath):
if not checkPrograms(config.gbpPath, uscanPath):
return false
# Check if root folder of projects is available
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment