Skip to content

Commit

Permalink
config.nims: fix NimSuggest crash.
Browse files Browse the repository at this point in the history
When editing in VSCode, NimSuggest refers to config.nims and tries
to find the NuttX .config.
Fixed a problem that .config cannot be read because the environment
variable "TOPDIR" is not defined.

Signed-off-by: Takeyoshi Kikuchi <[email protected]>
  • Loading branch information
centurysys authored and xiaoxiang781216 committed Jan 23, 2024
1 parent dabdad7 commit c82aa9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ proc setup_cfg(cfg: DotConfig) =
switch("define", "nimMemAlignTiny")


let topdir = getEnv("TOPDIR")
const key = "TOPDIR"
let topdir = if existsEnv(key): getEnv(key) else: thisDir() & "/../nuttx"
let cfg = read_config(topdir & "/.config")
cfg.setup_cfg()

0 comments on commit c82aa9f

Please sign in to comment.