summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/pure/os.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index a1dd5450d..229fad441 100755
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -1231,4 +1231,17 @@ proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1".} =
       close(f)
     else: OSError()
 
+proc findExe*(exe: string): string = 
+  ## Searches for `exe` in the current working directory and then
+  ## in directories listed in the ``PATH`` environment variable. 
+  ## Returns "" if the `exe` cannot be found. On DOS-like platforms, `exe` 
+  ## is added an ``.exe`` file extension if it has no extension.
+  result = addFileExt(exe, os.exeExt)
+  if ExistsFile(result): return
+  var path = os.getEnv("PATH")
+  for candidate in split(path, pathSep): 
+    var x = candidate / result
+    if ExistsFile(x): return x
+  result = ""
+
 {.pop.}
6f72bd75f3523afb2ea'>9cd5dfbd ^
3700c80a ^
9cd5dfbd ^

3700c80a ^
9cd5dfbd ^

3700c80
# Some debug info
echo "Running on $CI_RUNNER_ID ($CI_RUNNER_DESCRIPTION) with tags $CI_RUNNER_TAGS."

# Packages
apt-get update -qq
apt-get install -y -qq build-essential git libcurl4-openssl-dev libsdl1.2-dev libgc-dev nodejs

gcc -v

export PATH=$(pwd)/bin${PATH:+:$PATH}

# Nimble deps
nim e install_nimble.nims
nim e tests/test_nimscript.nims
nimble update
nimble install zip opengl sdl1 jester@#head niminst
f='#n19'>19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56