Compare commits

..

No commits in common. "main" and "1.0.12" have entirely different histories.
main ... 1.0.12

4 changed files with 17 additions and 12 deletions

View File

@ -1 +0,0 @@
nim 1.6.20

View File

@ -1 +1 @@
const PTK_VERSION* = "1.0.14"
const PTK_VERSION* = "1.0.12"

24
ptk.nim
View File

@ -307,21 +307,27 @@ Options:
quit()
# Find and parse the .ptkrc file
let ptkrcLocations =
if args["--config"]: @[$args["--config"]]
else: @[".ptkrc", $getEnv("PTKRC"), $getEnv("HOME") & "/.ptkrc"]
let ptkrcLocations = @[
if args["--config"]: $args["--config"] else:"",
".ptkrc", $getEnv("PTKRC"), $getEnv("HOME") & "/.ptkrc"]
let foundPtkrcLocations =
ptkrcLocations.filterIt(it.len > 0 and fileExists(it))
var ptkrcFilename: string =
foldl(ptkrcLocations, if len(a) > 0: a elif fileExists(b): b else: "")
var cfg: JsonNode
if foundPtkrcLocations.len < 1:
var cfgFile: File
if not fileExists(ptkrcFilename):
warn "ptk: could not find .ptkrc file."
debug "ptk: considered the following locations:\n\t" & ptkrcLocations.join("\n\t")
ptkrcFilename = $getEnv("HOME") & "/.ptkrc"
try:
cfgFile = open(ptkrcFilename, fmWrite)
cfgFile.write("{\"timelineLogFile\": \"timeline.log.json\"}")
except: warn "ptk: could not write default .ptkrc to " & ptkrcFilename
finally: close(cfgFile)
try: cfg = parseFile(foundPtkrcLocations[0])
try: cfg = parseFile(ptkrcFilename)
except: raise newException(IOError,
"unable to read config file: " & foundPtkrcLocations[0] &
"unable to read config file: " & ptkrcFilename &
"\x0D\x0A" & getCurrentExceptionMsg())
# Find the time log file

View File

@ -1,6 +1,6 @@
# Package
version = "1.0.14"
version = "1.0.12"
author = "Jonathan Bernard"
description = "Personal Time Keeper"
license = "MIT"