From faa6460491854908a3bf152e9c83a7d47de19994 Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Thu, 21 Sep 2023 00:59:44 -0600 Subject: [PATCH 1/2] Made it so compilation commands work as documented > command can be used by developers to compile individual modules inside their package Presently `nimble c nimblepkg/options` does not work. This addresses that. --- src/nimblepkg/options.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimblepkg/options.nim b/src/nimblepkg/options.nim index 33705678..f2a94143 100644 --- a/src/nimblepkg/options.nim +++ b/src/nimblepkg/options.nim @@ -772,7 +772,7 @@ proc getCompilationBinary*(options: Options, pkgInfo: PackageInfo): Option[strin of actionBuild, actionDoc, actionCompile: let file = options.action.file.changeFileExt("") if file.len > 0: - return some(file) + return some(pkgInfo.srcDir / file) of actionRun: let optRunFile = options.action.runFile let runFile = From 8976b7a7b9e814181a6c26f1a33f9217882270a0 Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Thu, 21 Sep 2023 18:45:47 -0600 Subject: [PATCH 2/2] Only use src dir if a file doesnt exist --- src/nimblepkg/options.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nimblepkg/options.nim b/src/nimblepkg/options.nim index f2a94143..d6bcf77e 100644 --- a/src/nimblepkg/options.nim +++ b/src/nimblepkg/options.nim @@ -772,7 +772,10 @@ proc getCompilationBinary*(options: Options, pkgInfo: PackageInfo): Option[strin of actionBuild, actionDoc, actionCompile: let file = options.action.file.changeFileExt("") if file.len > 0: - return some(pkgInfo.srcDir / file) + if fileExists(file): + return some(file) + else: + return some(pkgInfo.srcDir / file) of actionRun: let optRunFile = options.action.runFile let runFile =