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

create dir for log file

parent 2d8fb6cf
import configs
import .. / interfaces / logutils
import os
proc updateProjectAll(config: ProgConf) =
let resultLog = initResultLogs(config.logPath)
proc doUpdateProject(project: DebPackage): bool =
discard
proc updateProjectSingle(config: ProgConf) =
proc updateProjectAll(config: ProgConf) =
let
resultLog = initResultLogs(config.logPath)
fullLog = initFullLogs(config.logPath)
var project: DebPackage
project.log = fullLog
for kind, path in walkDir(config.rootPath):
if kind == pcDir:
project.path = path
project.name = path.splitPath.tail
if doUpdateProject(project):
# TODO use more status return for update status
resultLog.logInfo("[" & project.name & "] Update success")
proc updateProjectArr(config: ProgConf) =
let resultLog = initResultLogs(config.logPath)
discard
......@@ -15,12 +30,15 @@ proc updateProjectSingle(config: ProgConf) =
proc pullProjectAll(config: ProgConf) =
discard
proc pullProjectSingle(config: ProgConf) =
discard
proc cloneProject*() =
discard
proc handleUpdateProject*(projects: seq[string]) =
var config: ProgConf
if not initConfig(config):
......@@ -28,12 +46,13 @@ proc handleUpdateProject*(projects: seq[string]) =
if len(projects) == 0:
updateProjectAll(config)
else:
updateProjectSingle(config)
updateProjectArr(config)
# init project (log file, parse settings)
# TODO log project is started
# do the loop
discard
proc handlePullProject*(projects: seq[string]) =
var config: ProgConf
if not initConfig(config):
......
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