Skip to content

Commit

Permalink
Merge pull request #121 from ehmry/master
Browse files Browse the repository at this point in the history
Do not determine the config directory at compile-time
  • Loading branch information
Tangdongle authored Apr 4, 2022
2 parents 73327d1 + cb5b5ed commit 1426527
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const
]
# preloaded code into user's session
EmbeddedCode = staticRead("inimpkg/embedded.nim")

let
ConfigDir = getConfigDir() / "inim"
RcFilePath = ConfigDir / "inim.ini"

Expand Down Expand Up @@ -561,7 +563,7 @@ proc main(nim = "nim", srcFile = "", showHeader = true,
)
).join(" ")

discard existsorCreateDir(getConfigDir())
discard existsorCreateDir(ConfigDir)
let shouldCreateRc = not existsorCreateDir(rcFilePath.splitPath.head) or
not fileExists(rcFilePath) or createRcFile
config = if shouldCreateRc: createRcFile(rcFilePath)
Expand Down

0 comments on commit 1426527

Please sign in to comment.