From bfc4f255489801f248fed1d14ae558d207a49fb6 Mon Sep 17 00:00:00 2001 From: Ivan Bobev Date: Tue, 6 Aug 2019 18:08:51 +0300 Subject: [PATCH] Fix compilation of nimscriptapi.nim To compile the nimscriptapi.nim file, it is needed to import the os module, but if so the getParams procedure cannot be executed from nimscript any more. The problem is resolved by conditionally importing the module. Related to #680 --- src/nimblepkg/nimscriptapi.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nimblepkg/nimscriptapi.nim b/src/nimblepkg/nimscriptapi.nim index fffad4d..a8b4ba3 100644 --- a/src/nimblepkg/nimscriptapi.nim +++ b/src/nimblepkg/nimscriptapi.nim @@ -6,6 +6,9 @@ import system except getCommand, setCommand, switch, `--` import strformat, strutils, tables +when not defined(nimscript): + import os + var packageName* = "" ## Set this to the package name. It ## is usually not required to do that, nims' filename is