nimscript.html 108 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>system/nimscript</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">system/nimscript</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li>
  50. <details open>
  51. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  52. <ul class="simple simple-toc-section">
  53. <li><a class="reference" href="#ScriptMode" title="ScriptMode {.pure.} = enum
  54. Silent, ## Be silent.
  55. Verbose, ## Be verbose.
  56. Whatif ## Do not run commands, instead just echo what
  57. ## would have been done.">ScriptMode</a></li>
  58. </ul>
  59. </details>
  60. </li>
  61. <li>
  62. <details open>
  63. <summary><a class="reference reference-toplevel" href="#8" id="58">Vars</a></summary>
  64. <ul class="simple simple-toc-section">
  65. <li><a class="reference" href="#author" title="author: string">author</a></li>
  66. <li><a class="reference" href="#backend" title="backend: string">backend</a></li>
  67. <li><a class="reference" href="#bin" title="bin: seq[string] = @[]">bin</a></li>
  68. <li><a class="reference" href="#binDir" title="binDir: string">binDir</a></li>
  69. <li><a class="reference" href="#description" title="description: string">description</a></li>
  70. <li><a class="reference" href="#installDirs" title="installDirs: seq[string] = @[]">installDirs</a></li>
  71. <li><a class="reference" href="#installExt" title="installExt: seq[string] = @[]">installExt</a></li>
  72. <li><a class="reference" href="#installFiles" title="installFiles: seq[string] = @[]">installFiles</a></li>
  73. <li><a class="reference" href="#license" title="license: string">license</a></li>
  74. <li><a class="reference" href="#mode" title="mode: ScriptMode">mode</a></li>
  75. <li><a class="reference" href="#packageName" title="packageName = &quot;&quot;">packageName</a></li>
  76. <li><a class="reference" href="#requiresData" title="requiresData: seq[string] = @[]">requiresData</a></li>
  77. <li><a class="reference" href="#skipDirs" title="skipDirs: seq[string] = @[]">skipDirs</a></li>
  78. <li><a class="reference" href="#skipExt" title="skipExt: seq[string] = @[]">skipExt</a></li>
  79. <li><a class="reference" href="#skipFiles" title="skipFiles: seq[string] = @[]">skipFiles</a></li>
  80. <li><a class="reference" href="#srcDir" title="srcDir: string">srcDir</a></li>
  81. <li><a class="reference" href="#version" title="version: string">version</a></li>
  82. </ul>
  83. </details>
  84. </li>
  85. <li>
  86. <details open>
  87. <summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
  88. <ul class="simple simple-toc-section">
  89. <li><a class="reference" href="#buildCPU" title="buildCPU {.magic: &quot;BuildCPU&quot;.}: string = &quot;&quot;">buildCPU</a></li>
  90. <li><a class="reference" href="#buildOS" title="buildOS {.magic: &quot;BuildOS&quot;.}: string = &quot;&quot;">buildOS</a></li>
  91. </ul>
  92. </details>
  93. </li>
  94. <li>
  95. <details open>
  96. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  97. <ul class="simple simple-toc-section">
  98. <ul class="simple nested-toc-section">cd
  99. <li><a class="reference" href="#cd%2Cstring" title="cd(dir: string)">cd(dir: string)</a></li>
  100. </ul>
  101. <ul class="simple nested-toc-section">cmpic
  102. <li><a class="reference" href="#cmpic%2Cstring%2Cstring" title="cmpic(a, b: string): int">cmpic(a, b: string): int</a></li>
  103. </ul>
  104. <ul class="simple nested-toc-section">cpDir
  105. <li><a class="reference" href="#cpDir%2Cstring%2Cstring" title="cpDir(from, to: string)">cpDir(from, to: string)</a></li>
  106. </ul>
  107. <ul class="simple nested-toc-section">cpFile
  108. <li><a class="reference" href="#cpFile%2Cstring%2Cstring" title="cpFile(from, to: string)">cpFile(from, to: string)</a></li>
  109. </ul>
  110. <ul class="simple nested-toc-section">cppDefine
  111. <li><a class="reference" href="#cppDefine%2Cstring" title="cppDefine(define: string)">cppDefine(define: string)</a></li>
  112. </ul>
  113. <ul class="simple nested-toc-section">delEnv
  114. <li><a class="reference" href="#delEnv%2Cstring" title="delEnv(key: string)">delEnv(key: string)</a></li>
  115. </ul>
  116. <ul class="simple nested-toc-section">dirExists
  117. <li><a class="reference" href="#dirExists%2Cstring" title="dirExists(dir: string): bool">dirExists(dir: string): bool</a></li>
  118. </ul>
  119. <ul class="simple nested-toc-section">exec
  120. <li><a class="reference" href="#exec%2Cstring" title="exec(command: string)">exec(command: string)</a></li>
  121. <li><a class="reference" href="#exec%2Cstring%2Cstring%2Cstring" title="exec(command: string; input: string; cache = &quot;&quot;)">exec(command: string; input: string; cache = &quot;&quot;)</a></li>
  122. </ul>
  123. <ul class="simple nested-toc-section">exists
  124. <li><a class="reference" href="#exists%2Cstring" title="exists(key: string): bool">exists(key: string): bool</a></li>
  125. </ul>
  126. <ul class="simple nested-toc-section">existsEnv
  127. <li><a class="reference" href="#existsEnv%2Cstring" title="existsEnv(key: string): bool">existsEnv(key: string): bool</a></li>
  128. </ul>
  129. <ul class="simple nested-toc-section">fileExists
  130. <li><a class="reference" href="#fileExists%2Cstring" title="fileExists(filename: string): bool">fileExists(filename: string): bool</a></li>
  131. </ul>
  132. <ul class="simple nested-toc-section">findExe
  133. <li><a class="reference" href="#findExe%2Cstring" title="findExe(bin: string): string">findExe(bin: string): string</a></li>
  134. </ul>
  135. <ul class="simple nested-toc-section">get
  136. <li><a class="reference" href="#get%2Cstring" title="get(key: string): string">get(key: string): string</a></li>
  137. </ul>
  138. <ul class="simple nested-toc-section">getCommand
  139. <li><a class="reference" href="#getCommand" title="getCommand(): string">getCommand(): string</a></li>
  140. </ul>
  141. <ul class="simple nested-toc-section">getCurrentDir
  142. <li><a class="reference" href="#getCurrentDir" title="getCurrentDir(): string">getCurrentDir(): string</a></li>
  143. </ul>
  144. <ul class="simple nested-toc-section">getEnv
  145. <li><a class="reference" href="#getEnv%2Cstring%2Cstring" title="getEnv(key: string; default = &quot;&quot;): string">getEnv(key: string; default = &quot;&quot;): string</a></li>
  146. </ul>
  147. <ul class="simple nested-toc-section">hint
  148. <li><a class="reference" href="#hint%2Cstring%2Cbool" title="hint(name: string; val: bool)">hint(name: string; val: bool)</a></li>
  149. </ul>
  150. <ul class="simple nested-toc-section">listDirs
  151. <li><a class="reference" href="#listDirs%2Cstring" title="listDirs(dir: string): seq[string]">listDirs(dir: string): seq[string]</a></li>
  152. </ul>
  153. <ul class="simple nested-toc-section">listFiles
  154. <li><a class="reference" href="#listFiles%2Cstring" title="listFiles(dir: string): seq[string]">listFiles(dir: string): seq[string]</a></li>
  155. </ul>
  156. <ul class="simple nested-toc-section">mkDir
  157. <li><a class="reference" href="#mkDir%2Cstring" title="mkDir(dir: string)">mkDir(dir: string)</a></li>
  158. </ul>
  159. <ul class="simple nested-toc-section">mvDir
  160. <li><a class="reference" href="#mvDir%2Cstring%2Cstring" title="mvDir(from, to: string)">mvDir(from, to: string)</a></li>
  161. </ul>
  162. <ul class="simple nested-toc-section">mvFile
  163. <li><a class="reference" href="#mvFile%2Cstring%2Cstring" title="mvFile(from, to: string)">mvFile(from, to: string)</a></li>
  164. </ul>
  165. <ul class="simple nested-toc-section">nimcacheDir
  166. <li><a class="reference" href="#nimcacheDir" title="nimcacheDir(): string">nimcacheDir(): string</a></li>
  167. </ul>
  168. <ul class="simple nested-toc-section">paramCount
  169. <li><a class="reference" href="#paramCount" title="paramCount(): int">paramCount(): int</a></li>
  170. </ul>
  171. <ul class="simple nested-toc-section">paramStr
  172. <li><a class="reference" href="#paramStr%2Cint" title="paramStr(i: int): string">paramStr(i: int): string</a></li>
  173. </ul>
  174. <ul class="simple nested-toc-section">patchFile
  175. <li><a class="reference" href="#patchFile%2Cstring%2Cstring%2Cstring" title="patchFile(package, filename, replacement: string)">patchFile(package, filename, replacement: string)</a></li>
  176. </ul>
  177. <ul class="simple nested-toc-section">projectDir
  178. <li><a class="reference" href="#projectDir" title="projectDir(): string">projectDir(): string</a></li>
  179. </ul>
  180. <ul class="simple nested-toc-section">projectName
  181. <li><a class="reference" href="#projectName" title="projectName(): string">projectName(): string</a></li>
  182. </ul>
  183. <ul class="simple nested-toc-section">projectPath
  184. <li><a class="reference" href="#projectPath" title="projectPath(): string">projectPath(): string</a></li>
  185. </ul>
  186. <ul class="simple nested-toc-section">put
  187. <li><a class="reference" href="#put%2Cstring%2Cstring" title="put(key, value: string)">put(key, value: string)</a></li>
  188. </ul>
  189. <ul class="simple nested-toc-section">putEnv
  190. <li><a class="reference" href="#putEnv%2Cstring%2Cstring" title="putEnv(key, val: string)">putEnv(key, val: string)</a></li>
  191. </ul>
  192. <ul class="simple nested-toc-section">readAllFromStdin
  193. <li><a class="reference" href="#readAllFromStdin" title="readAllFromStdin(): string">readAllFromStdin(): string</a></li>
  194. </ul>
  195. <ul class="simple nested-toc-section">readLineFromStdin
  196. <li><a class="reference" href="#readLineFromStdin" title="readLineFromStdin(): string">readLineFromStdin(): string</a></li>
  197. </ul>
  198. <ul class="simple nested-toc-section">requires
  199. <li><a class="reference" href="#requires%2Cvarargs%5Bstring%5D" title="requires(deps: varargs[string])">requires(deps: varargs[string])</a></li>
  200. </ul>
  201. <ul class="simple nested-toc-section">rmDir
  202. <li><a class="reference" href="#rmDir%2Cstring" title="rmDir(dir: string; checkDir = false)">rmDir(dir: string; checkDir = false)</a></li>
  203. </ul>
  204. <ul class="simple nested-toc-section">rmFile
  205. <li><a class="reference" href="#rmFile%2Cstring" title="rmFile(file: string)">rmFile(file: string)</a></li>
  206. </ul>
  207. <ul class="simple nested-toc-section">selfExe
  208. <li><a class="reference" href="#selfExe" title="selfExe(): string">selfExe(): string</a></li>
  209. </ul>
  210. <ul class="simple nested-toc-section">selfExec
  211. <li><a class="reference" href="#selfExec%2Cstring" title="selfExec(command: string)">selfExec(command: string)</a></li>
  212. </ul>
  213. <ul class="simple nested-toc-section">setCommand
  214. <li><a class="reference" href="#setCommand%2Cstring%2Cstring" title="setCommand(cmd: string; project = &quot;&quot;)">setCommand(cmd: string; project = &quot;&quot;)</a></li>
  215. </ul>
  216. <ul class="simple nested-toc-section">switch
  217. <li><a class="reference" href="#switch%2Cstring%2Cstring" title="switch(key: string; val = &quot;&quot;)">switch(key: string; val = &quot;&quot;)</a></li>
  218. </ul>
  219. <ul class="simple nested-toc-section">thisDir
  220. <li><a class="reference" href="#thisDir" title="thisDir(): string">thisDir(): string</a></li>
  221. </ul>
  222. <ul class="simple nested-toc-section">toDll
  223. <li><a class="reference" href="#toDll%2Cstring" title="toDll(filename: string): string">toDll(filename: string): string</a></li>
  224. </ul>
  225. <ul class="simple nested-toc-section">toExe
  226. <li><a class="reference" href="#toExe%2Cstring" title="toExe(filename: string): string">toExe(filename: string): string</a></li>
  227. </ul>
  228. <ul class="simple nested-toc-section">warning
  229. <li><a class="reference" href="#warning%2Cstring%2Cbool" title="warning(name: string; val: bool)">warning(name: string; val: bool)</a></li>
  230. </ul>
  231. </ul>
  232. </details>
  233. </li>
  234. <li>
  235. <details open>
  236. <summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
  237. <ul class="simple simple-toc-section">
  238. <ul class="simple nested-toc-section">--
  239. <li><a class="reference" href="#--.t%2Cuntyped%2Cuntyped" title="`--`(key, val: untyped)">`--`(key, val: untyped)</a></li>
  240. <li><a class="reference" href="#--.t%2Cuntyped" title="`--`(key: untyped)">`--`(key: untyped)</a></li>
  241. </ul>
  242. <ul class="simple nested-toc-section">task
  243. <li><a class="reference" href="#task.t%2Cuntyped%2Cstring%2Cuntyped" title="task(name: untyped; description: string; body: untyped): untyped">task(name: untyped; description: string; body: untyped): untyped</a></li>
  244. </ul>
  245. <ul class="simple nested-toc-section">withDir
  246. <li><a class="reference" href="#withDir.t%2Cstring%2Cuntyped" title="withDir(dir: string; body: untyped): untyped">withDir(dir: string; body: untyped): untyped</a></li>
  247. </ul>
  248. </ul>
  249. </details>
  250. </li>
  251. </ul>
  252. </div>
  253. <div class="nine columns" id="content">
  254. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  255. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  256. <div id="tocRoot"></div>
  257. <p class="module-desc">To learn about scripting in Nim see <a class="reference external" href="nims.html">NimScript</a></p>
  258. <div class="section" id="7">
  259. <h1><a class="toc-backref" href="#7">Types</a></h1>
  260. <dl class="item">
  261. <div id="ScriptMode">
  262. <dt><pre><a href="nimscript.html#ScriptMode"><span class="Identifier">ScriptMode</span></a> {.<span class="Identifier">pure</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
  263. <span class="Identifier">Silent</span><span class="Other">,</span> <span class="Comment">## Be silent.</span>
  264. <span class="Identifier">Verbose</span><span class="Other">,</span> <span class="Comment">## Be verbose.</span>
  265. <span class="Identifier">Whatif</span> <span class="Comment">## Do not run commands, instead just echo what</span>
  266. <span class="Comment">## would have been done.</span></pre></dt>
  267. <dd>
  268. Controls the behaviour of the script.
  269. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L177" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  270. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L177" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  271. </dd>
  272. </div>
  273. </dl>
  274. </div>
  275. <div class="section" id="8">
  276. <h1><a class="toc-backref" href="#8">Vars</a></h1>
  277. <dl class="item">
  278. <div id="author">
  279. <dt><pre><a href="nimscript.html#author"><span class="Identifier">author</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  280. <dd>
  281. Nimble support: The package's author.
  282. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L435" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  283. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L435" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  284. </dd>
  285. </div>
  286. <div id="backend">
  287. <dt><pre><a href="nimscript.html#backend"><span class="Identifier">backend</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  288. <dd>
  289. Nimble support: The package's backend.
  290. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L440" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  291. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L440" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  292. </dd>
  293. </div>
  294. <div id="bin">
  295. <dt><pre><a href="nimscript.html#bin"><span class="Identifier">bin</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  296. <dd>
  297. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  298. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  299. </dd>
  300. </div>
  301. <div id="binDir">
  302. <dt><pre><a href="nimscript.html#binDir"><span class="Identifier">binDir</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  303. <dd>
  304. Nimble support: The package's binary directory.
  305. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L439" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  306. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L439" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  307. </dd>
  308. </div>
  309. <div id="description">
  310. <dt><pre><a href="nimscript.html#description"><span class="Identifier">description</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  311. <dd>
  312. Nimble support: The package's description.
  313. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L436" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  314. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L436" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  315. </dd>
  316. </div>
  317. <div id="installDirs">
  318. <dt><pre><a href="nimscript.html#installDirs"><span class="Identifier">installDirs</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  319. <dd>
  320. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  321. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  322. </dd>
  323. </div>
  324. <div id="installExt">
  325. <dt><pre><a href="nimscript.html#installExt"><span class="Identifier">installExt</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  326. <dd>
  327. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  328. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  329. </dd>
  330. </div>
  331. <div id="installFiles">
  332. <dt><pre><a href="nimscript.html#installFiles"><span class="Identifier">installFiles</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  333. <dd>
  334. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  335. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  336. </dd>
  337. </div>
  338. <div id="license">
  339. <dt><pre><a href="nimscript.html#license"><span class="Identifier">license</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  340. <dd>
  341. Nimble support: The package's license.
  342. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L437" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  343. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L437" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  344. </dd>
  345. </div>
  346. <div id="mode">
  347. <dt><pre><a href="nimscript.html#mode"><span class="Identifier">mode</span></a><span class="Other">:</span> <a href="nimscript.html#ScriptMode"><span class="Identifier">ScriptMode</span></a></pre></dt>
  348. <dd>
  349. Set this to influence how mkDir, rmDir, rmFile etc. behave
  350. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L184" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  351. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L184" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  352. </dd>
  353. </div>
  354. <div id="packageName">
  355. <dt><pre><a href="nimscript.html#packageName"><span class="Identifier">packageName</span></a> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span></pre></dt>
  356. <dd>
  357. Nimble support: Set this to the package name. It is usually not required to do that, nims' filename is the default.
  358. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L431" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  359. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  360. </dd>
  361. </div>
  362. <div id="requiresData">
  363. <dt><pre><a href="nimscript.html#requiresData"><span class="Identifier">requiresData</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  364. <dd>
  365. Exposes the list of requirements for read and write accesses.
  366. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L444" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  367. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L444" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  368. </dd>
  369. </div>
  370. <div id="skipDirs">
  371. <dt><pre><a href="nimscript.html#skipDirs"><span class="Identifier">skipDirs</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  372. <dd>
  373. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  374. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  375. </dd>
  376. </div>
  377. <div id="skipExt">
  378. <dt><pre><a href="nimscript.html#skipExt"><span class="Identifier">skipExt</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  379. <dd>
  380. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  381. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  382. </dd>
  383. </div>
  384. <div id="skipFiles">
  385. <dt><pre><a href="nimscript.html#skipFiles"><span class="Identifier">skipFiles</span></a><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span></pre></dt>
  386. <dd>
  387. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  388. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  389. </dd>
  390. </div>
  391. <div id="srcDir">
  392. <dt><pre><a href="nimscript.html#srcDir"><span class="Identifier">srcDir</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  393. <dd>
  394. Nimble support: The package's source directory.
  395. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L438" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  396. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L438" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  397. </dd>
  398. </div>
  399. <div id="version">
  400. <dt><pre><a href="nimscript.html#version"><span class="Identifier">version</span></a><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  401. <dd>
  402. Nimble support: The package's version.
  403. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L434" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  404. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L434" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  405. </dd>
  406. </div>
  407. </dl>
  408. </div>
  409. <div class="section" id="10">
  410. <h1><a class="toc-backref" href="#10">Consts</a></h1>
  411. <dl class="item">
  412. <div id="buildCPU">
  413. <dt><pre><a href="nimscript.html#buildCPU"><span class="Identifier">buildCPU</span></a> {.<span class="Identifier">magic</span><span class="Other">:</span> <span class="StringLit">&quot;BuildCPU&quot;</span>.}<span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span></pre></dt>
  414. <dd>
  415. The CPU this build is running on. Can be different from <tt class="docutils literal"><span class="pre"><span class="Identifier">system</span><span class="Operator">.</span><span class="Identifier">hostCPU</span></span></tt> for cross compilations.
  416. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L20" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  417. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L20" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  418. </dd>
  419. </div>
  420. <div id="buildOS">
  421. <dt><pre><a href="nimscript.html#buildOS"><span class="Identifier">buildOS</span></a> {.<span class="Identifier">magic</span><span class="Other">:</span> <span class="StringLit">&quot;BuildOS&quot;</span>.}<span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span></pre></dt>
  422. <dd>
  423. The OS this build is running on. Can be different from <tt class="docutils literal"><span class="pre"><span class="Identifier">system</span><span class="Operator">.</span><span class="Identifier">hostOS</span></span></tt> for cross compilations.
  424. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L16" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  425. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L16" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  426. </dd>
  427. </div>
  428. </dl>
  429. </div>
  430. <div class="section" id="12">
  431. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  432. <dl class="item">
  433. <div id="cd-procs-all">
  434. <div id="cd,string">
  435. <dt><pre><span class="Keyword">proc</span> <a href="#cd%2Cstring"><span class="Identifier">cd</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  436. <dd>
  437. <p>Changes the current directory.</p>
  438. <p>The change is permanent for the rest of the execution, since this is just a shortcut for <a class="reference external" href="os.html#setCurrentDir,string">os.setCurrentDir()</a> . Use the <a class="reference external" href="#withDir.t,string,untyped">withDir()</a> template if you want to perform a temporary change only.</p>
  439. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L328" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  440. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L328" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  441. </dd>
  442. </div>
  443. </div>
  444. <div id="cmpic-procs-all">
  445. <div id="cmpic,string,string">
  446. <dt><pre><span class="Keyword">proc</span> <a href="#cmpic%2Cstring%2Cstring"><span class="Identifier">cmpic</span></a><span class="Other">(</span><span class="Identifier">a</span><span class="Other">,</span> <span class="Identifier">b</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  447. <dd>
  448. Compares <tt class="docutils literal"><span class="pre"><span class="Identifier">a</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">b</span></span></tt> ignoring case.
  449. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L110" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  450. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L110" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  451. </dd>
  452. </div>
  453. </div>
  454. <div id="cpDir-procs-all">
  455. <div id="cpDir,string,string">
  456. <dt><pre><span class="Keyword">proc</span> <a href="#cpDir%2Cstring%2Cstring"><span class="Identifier">cpDir</span></a><span class="Other">(</span><span class="Identifier">from</span><span class="Other">,</span> <span class="Identifier">to</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  457. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  458. <dd>
  459. Copies the dir <tt class="docutils literal"><span class="pre"><span class="Keyword">from</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">to</span></span></tt>.
  460. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L247" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  461. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L247" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  462. </dd>
  463. </div>
  464. </div>
  465. <div id="cpFile-procs-all">
  466. <div id="cpFile,string,string">
  467. <dt><pre><span class="Keyword">proc</span> <a href="#cpFile%2Cstring%2Cstring"><span class="Identifier">cpFile</span></a><span class="Other">(</span><span class="Identifier">from</span><span class="Other">,</span> <span class="Identifier">to</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  468. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  469. <dd>
  470. Copies the file <tt class="docutils literal"><span class="pre"><span class="Keyword">from</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">to</span></span></tt>.
  471. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L241" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  472. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L241" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  473. </dd>
  474. </div>
  475. </div>
  476. <div id="cppDefine-procs-all">
  477. <div id="cppDefine,string">
  478. <dt><pre><span class="Keyword">proc</span> <a href="#cppDefine%2Cstring"><span class="Identifier">cppDefine</span></a><span class="Other">(</span><span class="Identifier">define</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  479. <dd>
  480. tell Nim that <tt class="docutils literal"><span class="pre"><span class="Identifier">define</span></span></tt> is a C preprocessor <tt class="docutils literal"><span class="pre"><span class="Comment">#define</span></span></tt> and so always needs to be mangled.
  481. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L368" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  482. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L368" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  483. </dd>
  484. </div>
  485. </div>
  486. <div id="delEnv-procs-all">
  487. <div id="delEnv,string">
  488. <dt><pre><span class="Keyword">proc</span> <a href="#delEnv%2Cstring"><span class="Identifier">delEnv</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#WriteIOEffect"><span class="Identifier">WriteIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  489. <dd>
  490. Deletes the environment variable named <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>.
  491. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L126" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  492. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L126" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  493. </dd>
  494. </div>
  495. </div>
  496. <div id="dirExists-procs-all">
  497. <div id="dirExists,string">
  498. <dt><pre><span class="Keyword">proc</span> <a href="#dirExists%2Cstring"><span class="Identifier">dirExists</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  499. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  500. <dd>
  501. Checks if the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt> exists.
  502. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L134" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  503. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L134" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  504. </dd>
  505. </div>
  506. </div>
  507. <div id="exec-procs-all">
  508. <div id="exec,string">
  509. <dt><pre><span class="Keyword">proc</span> <a href="#exec%2Cstring"><span class="Identifier">exec</span></a><span class="Other">(</span><span class="Identifier">command</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  510. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ExecIOEffect"><span class="Identifier">ExecIOEffect</span></a><span class="Other">,</span> <a href="exceptions.html#WriteIOEffect"><span class="Identifier">WriteIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  511. <dd>
  512. Executes an external process. If the external process terminates with a non-zero exit code, an OSError exception is raised. The command is executed relative to the current source path.<div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
  513. If you need a version of <tt class="docutils literal"><span class="pre"><span class="Identifier">exec</span></span></tt> that returns the exit code and text output of the command, you can use <a class="reference external" href="system.html#gorgeEx,string,string,string">system.gorgeEx</a>.</div>
  514. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L253" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  515. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L253" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  516. </dd>
  517. </div>
  518. <div id="exec,string,string,string">
  519. <dt><pre><span class="Keyword">proc</span> <a href="#exec%2Cstring%2Cstring%2Cstring"><span class="Identifier">exec</span></a><span class="Other">(</span><span class="Identifier">command</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">input</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">cache</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  520. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ExecIOEffect"><span class="Identifier">ExecIOEffect</span></a><span class="Other">,</span> <a href="exceptions.html#WriteIOEffect"><span class="Identifier">WriteIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  521. <dd>
  522. Executes an external process. If the external process terminates with a non-zero exit code, an OSError exception is raised.<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
  523. This version of <tt class="docutils literal"><span class="pre"><span class="Identifier">exec</span></span></tt> is executed relative to the nimscript module path, which affects how the command resolves relative paths. Thus it is generally better to use <tt class="docutils literal"><span class="pre"><span class="Identifier">gorgeEx</span></span></tt> directly when you need more control over the execution environment or when working with commands that deal with relative paths.</div>
  524. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L267" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  525. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L267" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  526. </dd>
  527. </div>
  528. </div>
  529. <div id="exists-procs-all">
  530. <div id="exists,string">
  531. <dt><pre><span class="Keyword">proc</span> <a href="#exists%2Cstring"><span class="Identifier">exists</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  532. <dd>
  533. Checks for the existence of a configuration 'key' like 'gcc.options.always'.
  534. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L301" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  535. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L301" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  536. </dd>
  537. </div>
  538. </div>
  539. <div id="existsEnv-procs-all">
  540. <div id="existsEnv,string">
  541. <dt><pre><span class="Keyword">proc</span> <a href="#existsEnv%2Cstring"><span class="Identifier">existsEnv</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  542. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  543. <dd>
  544. Checks for the existence of an environment variable named <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>.
  545. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L118" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  546. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L118" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  547. </dd>
  548. </div>
  549. </div>
  550. <div id="fileExists-procs-all">
  551. <div id="fileExists,string">
  552. <dt><pre><span class="Keyword">proc</span> <a href="#fileExists%2Cstring"><span class="Identifier">fileExists</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  553. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  554. <dd>
  555. Checks if the file exists.
  556. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L130" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  557. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L130" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  558. </dd>
  559. </div>
  560. </div>
  561. <div id="findExe-procs-all">
  562. <div id="findExe,string">
  563. <dt><pre><span class="Keyword">proc</span> <a href="#findExe%2Cstring"><span class="Identifier">findExe</span></a><span class="Other">(</span><span class="Identifier">bin</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  564. <dd>
  565. Searches for bin in the current working directory and then in directories listed in the PATH environment variable. Returns &quot;&quot; if the exe cannot be found.
  566. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L338" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  567. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L338" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  568. </dd>
  569. </div>
  570. </div>
  571. <div id="get-procs-all">
  572. <div id="get,string">
  573. <dt><pre><span class="Keyword">proc</span> <a href="#get%2Cstring"><span class="Identifier">get</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  574. <dd>
  575. Retrieves a configuration 'key' like 'gcc.options.always'.
  576. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L297" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  577. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L297" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  578. </dd>
  579. </div>
  580. </div>
  581. <div id="getCommand-procs-all">
  582. <div id="getCommand">
  583. <dt><pre><span class="Keyword">proc</span> <a href="#getCommand"><span class="Identifier">getCommand</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  584. <dd>
  585. Gets the Nim command that the compiler has been invoked with, for example &quot;c&quot;, &quot;js&quot;, &quot;build&quot;, &quot;help&quot;.
  586. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L97" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  587. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L97" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  588. </dd>
  589. </div>
  590. </div>
  591. <div id="getCurrentDir-procs-all">
  592. <div id="getCurrentDir">
  593. <dt><pre><span class="Keyword">proc</span> <a href="#getCurrentDir"><span class="Identifier">getCurrentDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  594. <dd>
  595. Retrieves the current working directory.
  596. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L50" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  597. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L50" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  598. </dd>
  599. </div>
  600. </div>
  601. <div id="getEnv-procs-all">
  602. <div id="getEnv,string,string">
  603. <dt><pre><span class="Keyword">proc</span> <a href="#getEnv%2Cstring%2Cstring"><span class="Identifier">getEnv</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">default</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span>
  604. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  605. <dd>
  606. Retrieves the environment variable of name <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>.
  607. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L114" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  608. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L114" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  609. </dd>
  610. </div>
  611. </div>
  612. <div id="hint-procs-all">
  613. <div id="hint,string,bool">
  614. <dt><pre><span class="Keyword">proc</span> <a href="#hint%2Cstring%2Cbool"><span class="Identifier">hint</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">val</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  615. <dd>
  616. Disables or enables a specific hint.
  617. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L77" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  618. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L77" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  619. </dd>
  620. </div>
  621. </div>
  622. <div id="listDirs-procs-all">
  623. <div id="listDirs,string">
  624. <dt><pre><span class="Keyword">proc</span> <a href="#listDirs%2Cstring"><span class="Identifier">listDirs</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
  625. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  626. <dd>
  627. Lists all the subdirectories (non-recursively) in the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt>.
  628. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L200" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  629. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L200" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  630. </dd>
  631. </div>
  632. </div>
  633. <div id="listFiles-procs-all">
  634. <div id="listFiles,string">
  635. <dt><pre><span class="Keyword">proc</span> <a href="#listFiles%2Cstring"><span class="Identifier">listFiles</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#seq"><span class="Identifier">seq</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
  636. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  637. <dd>
  638. Lists all the files (non-recursively) in the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt>.
  639. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L205" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  640. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L205" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  641. </dd>
  642. </div>
  643. </div>
  644. <div id="mkDir-procs-all">
  645. <div id="mkDir,string">
  646. <dt><pre><span class="Keyword">proc</span> <a href="#mkDir%2Cstring"><span class="Identifier">mkDir</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  647. <dd>
  648. Creates the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt> including all necessary subdirectories. If the directory already exists, no error is raised.
  649. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L222" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  650. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L222" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  651. </dd>
  652. </div>
  653. </div>
  654. <div id="mvDir-procs-all">
  655. <div id="mvDir,string,string">
  656. <dt><pre><span class="Keyword">proc</span> <a href="#mvDir%2Cstring%2Cstring"><span class="Identifier">mvDir</span></a><span class="Other">(</span><span class="Identifier">from</span><span class="Other">,</span> <span class="Identifier">to</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  657. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  658. <dd>
  659. Moves the dir <tt class="docutils literal"><span class="pre"><span class="Keyword">from</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">to</span></span></tt>.
  660. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L235" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  661. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L235" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  662. </dd>
  663. </div>
  664. </div>
  665. <div id="mvFile-procs-all">
  666. <div id="mvFile,string,string">
  667. <dt><pre><span class="Keyword">proc</span> <a href="#mvFile%2Cstring%2Cstring"><span class="Identifier">mvFile</span></a><span class="Other">(</span><span class="Identifier">from</span><span class="Other">,</span> <span class="Identifier">to</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  668. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  669. <dd>
  670. Moves the file <tt class="docutils literal"><span class="pre"><span class="Keyword">from</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">to</span></span></tt>.
  671. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L229" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  672. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L229" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  673. </dd>
  674. </div>
  675. </div>
  676. <div id="nimcacheDir-procs-all">
  677. <div id="nimcacheDir">
  678. <dt><pre><span class="Keyword">proc</span> <a href="#nimcacheDir"><span class="Identifier">nimcacheDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  679. <dd>
  680. Retrieves the location of 'nimcache'.
  681. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L306" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  682. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L306" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  683. </dd>
  684. </div>
  685. </div>
  686. <div id="paramCount-procs-all">
  687. <div id="paramCount">
  688. <dt><pre><span class="Keyword">proc</span> <a href="#paramCount"><span class="Identifier">paramCount</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  689. <dd>
  690. Retrieves the number of command line parameters.
  691. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L63" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  692. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L63" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  693. </dd>
  694. </div>
  695. </div>
  696. <div id="paramStr-procs-all">
  697. <div id="paramStr,int">
  698. <dt><pre><span class="Keyword">proc</span> <a href="#paramStr%2Cint"><span class="Identifier">paramStr</span></a><span class="Other">(</span><span class="Identifier">i</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  699. <dd>
  700. Retrieves the <tt class="docutils literal"><span class="pre"><span class="Identifier">i</span></span></tt>'th command line parameter.
  701. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L59" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  702. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L59" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  703. </dd>
  704. </div>
  705. </div>
  706. <div id="patchFile-procs-all">
  707. <div id="patchFile,string,string,string">
  708. <dt><pre><span class="Keyword">proc</span> <a href="#patchFile%2Cstring%2Cstring%2Cstring"><span class="Identifier">patchFile</span></a><span class="Other">(</span><span class="Identifier">package</span><span class="Other">,</span> <span class="Identifier">filename</span><span class="Other">,</span> <span class="Identifier">replacement</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  709. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  710. <dd>
  711. <p>Overrides the location of a given file belonging to the passed package. If the <tt class="docutils literal"><span class="pre"><span class="Identifier">replacement</span></span></tt> is not an absolute path, the path is interpreted to be local to the Nimscript file that contains the call to <tt class="docutils literal"><span class="pre"><span class="Identifier">patchFile</span></span></tt>, Nim's <tt class="docutils literal"><span class="pre"><span class="Operator">--</span><span class="Identifier">path</span></span></tt> is not used at all to resolve the filename! The compiler also performs <a class="reference external" href="nimc.html#compiler-usage-commandminusline-switches">path substitution</a> on <tt class="docutils literal"><span class="pre"><span class="Identifier">replacement</span></span></tt>.</p>
  712. <p>Example:</p>
  713. <p><pre class="listing"><span class="Identifier">patchFile</span><span class="Punctuation">(</span><span class="StringLit">&quot;stdlib&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;asyncdispatch&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;patches/replacement&quot;</span><span class="Punctuation">)</span></pre></p>
  714. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L82" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  715. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L82" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  716. </dd>
  717. </div>
  718. </div>
  719. <div id="projectDir-procs-all">
  720. <div id="projectDir">
  721. <dt><pre><span class="Keyword">proc</span> <a href="#projectDir"><span class="Identifier">projectDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  722. <dd>
  723. Retrieves the absolute directory of the current project
  724. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L314" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  725. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L314" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  726. </dd>
  727. </div>
  728. </div>
  729. <div id="projectName-procs-all">
  730. <div id="projectName">
  731. <dt><pre><span class="Keyword">proc</span> <a href="#projectName"><span class="Identifier">projectName</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  732. <dd>
  733. Retrieves the name of the current project
  734. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L310" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  735. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L310" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  736. </dd>
  737. </div>
  738. </div>
  739. <div id="projectPath-procs-all">
  740. <div id="projectPath">
  741. <dt><pre><span class="Keyword">proc</span> <a href="#projectPath"><span class="Identifier">projectPath</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  742. <dd>
  743. Retrieves the absolute path of the current project
  744. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L318" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  745. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L318" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  746. </dd>
  747. </div>
  748. </div>
  749. <div id="put-procs-all">
  750. <div id="put,string,string">
  751. <dt><pre><span class="Keyword">proc</span> <a href="#put%2Cstring%2Cstring"><span class="Identifier">put</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">,</span> <span class="Identifier">value</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  752. <dd>
  753. Sets a configuration 'key' like 'gcc.options.always' to its value.
  754. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L293" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  755. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L293" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  756. </dd>
  757. </div>
  758. </div>
  759. <div id="putEnv-procs-all">
  760. <div id="putEnv,string,string">
  761. <dt><pre><span class="Keyword">proc</span> <a href="#putEnv%2Cstring%2Cstring"><span class="Identifier">putEnv</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">,</span> <span class="Identifier">val</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#WriteIOEffect"><span class="Identifier">WriteIOEffect</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  762. <dd>
  763. Sets the value of the environment variable named <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">val</span></span></tt>.
  764. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L122" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  765. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L122" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  766. </dd>
  767. </div>
  768. </div>
  769. <div id="readAllFromStdin-procs-all">
  770. <div id="readAllFromStdin">
  771. <dt><pre><span class="Keyword">proc</span> <a href="#readAllFromStdin"><span class="Identifier">readAllFromStdin</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#IOError"><span class="Identifier">IOError</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
  772. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  773. <dd>
  774. Reads all data from stdin - blocks until EOF which happens when stdin is closed
  775. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L387" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  776. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L387" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  777. </dd>
  778. </div>
  779. </div>
  780. <div id="readLineFromStdin-procs-all">
  781. <div id="readLineFromStdin">
  782. <dt><pre><span class="Keyword">proc</span> <a href="#readLineFromStdin"><span class="Identifier">readLineFromStdin</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#IOError"><span class="Identifier">IOError</span></a><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
  783. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  784. <dd>
  785. Reads a line of data from stdin - blocks until n or EOF which happens when stdin is closed
  786. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L381" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  787. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L381" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  788. </dd>
  789. </div>
  790. </div>
  791. <div id="requires-procs-all">
  792. <div id="requires,varargs[string]">
  793. <dt><pre><span class="Keyword">proc</span> <a href="#requires%2Cvarargs%5Bstring%5D"><span class="Identifier">requires</span></a><span class="Other">(</span><span class="Identifier">deps</span><span class="Other">:</span> <a href="system.html#varargs"><span class="Identifier">varargs</span></a><span class="Other">[</span><a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">]</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  794. <dd>
  795. Nimble support: Call this to set the list of requirements of your Nimble package.
  796. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L447" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  797. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L447" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  798. </dd>
  799. </div>
  800. </div>
  801. <div id="rmDir-procs-all">
  802. <div id="rmDir,string">
  803. <dt><pre><span class="Keyword">proc</span> <a href="#rmDir%2Cstring"><span class="Identifier">rmDir</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">checkDir</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  804. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  805. <dd>
  806. Removes the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt>.
  807. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L210" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  808. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L210" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  809. </dd>
  810. </div>
  811. </div>
  812. <div id="rmFile-procs-all">
  813. <div id="rmFile,string">
  814. <dt><pre><span class="Keyword">proc</span> <a href="#rmFile%2Cstring"><span class="Identifier">rmFile</span></a><span class="Other">(</span><span class="Identifier">file</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  815. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  816. <dd>
  817. Removes the <tt class="docutils literal"><span class="pre"><span class="Identifier">file</span></span></tt>.
  818. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L216" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  819. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L216" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  820. </dd>
  821. </div>
  822. </div>
  823. <div id="selfExe-procs-all">
  824. <div id="selfExe">
  825. <dt><pre><span class="Keyword">proc</span> <a href="#selfExe"><span class="Identifier">selfExe</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Deprecated since v1.7; Use getCurrentCompilerExe&quot;</span><span class="Other">,</span>
  826. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  827. <dd>
  828. <div class="deprecation-message">
  829. <b>Deprecated:</b> Deprecated since v1.7; Use getCurrentCompilerExe
  830. </div>
  831. Returns the currently running nim or nimble executable.
  832. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L139" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  833. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L139" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  834. </dd>
  835. </div>
  836. </div>
  837. <div id="selfExec-procs-all">
  838. <div id="selfExec,string">
  839. <dt><pre><span class="Keyword">proc</span> <a href="#selfExec%2Cstring"><span class="Identifier">selfExec</span></a><span class="Other">(</span><span class="Identifier">command</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">]</span><span class="Other">,</span>
  840. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="exceptions.html#ExecIOEffect"><span class="Identifier">ExecIOEffect</span></a><span class="Other">,</span> <a href="exceptions.html#WriteIOEffect"><span class="Identifier">WriteIOEffect</span></a><span class="Other">]</span><span class="Other">,</span>
  841. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  842. <dd>
  843. Executes an external command with the current nim/nimble executable. <tt class="docutils literal"><span class="pre"><span class="Identifier">Command</span></span></tt> must not contain the &quot;nim &quot; part.
  844. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L283" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  845. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L283" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  846. </dd>
  847. </div>
  848. </div>
  849. <div id="setCommand-procs-all">
  850. <div id="setCommand,string,string">
  851. <dt><pre><span class="Keyword">proc</span> <a href="#setCommand%2Cstring%2Cstring"><span class="Identifier">setCommand</span></a><span class="Other">(</span><span class="Identifier">cmd</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">project</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  852. <dd>
  853. Sets the Nim command that should be continued with after this Nimscript has finished.
  854. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L102" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  855. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L102" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  856. </dd>
  857. </div>
  858. </div>
  859. <div id="switch-procs-all">
  860. <div id="switch,string,string">
  861. <dt><pre><span class="Keyword">proc</span> <a href="#switch%2Cstring%2Cstring"><span class="Identifier">switch</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">val</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  862. <dd>
  863. Sets a Nim compiler command line switch, for example <tt class="docutils literal"><span class="pre"><span class="Identifier">switch</span><span class="Punctuation">(</span><span class="StringLit">&quot;checks&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;on&quot;</span><span class="Punctuation">)</span></span></tt>.
  864. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L67" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  865. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L67" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  866. </dd>
  867. </div>
  868. </div>
  869. <div id="thisDir-procs-all">
  870. <div id="thisDir">
  871. <dt><pre><span class="Keyword">proc</span> <a href="#thisDir"><span class="Identifier">thisDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  872. <dd>
  873. Retrieves the directory of the current <tt class="docutils literal"><span class="pre"><span class="Identifier">nims</span></span></tt> script file. Its path is obtained via <tt class="docutils literal"><span class="pre"><span class="Identifier">currentSourcePath</span></span></tt> (although, currently, <tt class="docutils literal"><span class="pre"><span class="Identifier">currentSourcePath</span></span></tt> resolves symlinks, unlike <tt class="docutils literal"><span class="pre"><span class="Identifier">thisDir</span></span></tt>).
  874. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L322" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  875. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L322" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  876. </dd>
  877. </div>
  878. </div>
  879. <div id="toDll-procs-all">
  880. <div id="toDll,string">
  881. <dt><pre><span class="Keyword">proc</span> <a href="#toDll%2Cstring"><span class="Identifier">toDll</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  882. <dd>
  883. On Windows adds &quot;.dll&quot; to <tt class="docutils literal"><span class="pre"><span class="Identifier">filename</span></span></tt>, on Posix produces &quot;lib$filename.so&quot;.
  884. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L147" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  885. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L147" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  886. </dd>
  887. </div>
  888. </div>
  889. <div id="toExe-procs-all">
  890. <div id="toExe,string">
  891. <dt><pre><span class="Keyword">proc</span> <a href="#toExe%2Cstring"><span class="Identifier">toExe</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  892. <dd>
  893. On Windows adds &quot;.exe&quot; to <tt class="docutils literal"><span class="pre"><span class="Identifier">filename</span></span></tt>, else returns <tt class="docutils literal"><span class="pre"><span class="Identifier">filename</span></span></tt> unmodified.
  894. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L143" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  895. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L143" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  896. </dd>
  897. </div>
  898. </div>
  899. <div id="warning-procs-all">
  900. <div id="warning,string,bool">
  901. <dt><pre><span class="Keyword">proc</span> <a href="#warning%2Cstring%2Cbool"><span class="Identifier">warning</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">val</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  902. <dd>
  903. Disables or enables a specific warning.
  904. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L72" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  905. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L72" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  906. </dd>
  907. </div>
  908. </div>
  909. </dl>
  910. </div>
  911. <div class="section" id="18">
  912. <h1><a class="toc-backref" href="#18">Templates</a></h1>
  913. <dl class="item">
  914. <div id="---templates-all">
  915. <div id="--.t,untyped,untyped">
  916. <dt><pre><span class="Keyword">template</span> <a href="#--.t%2Cuntyped%2Cuntyped"><span class="Identifier">`--`</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">,</span> <span class="Identifier">val</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a><span class="Other">)</span></pre></dt>
  917. <dd>
  918. <p>A shortcut for <a class="reference external" href="#switch,string,string">switch</a> Example:</p>
  919. <p><pre class="listing"><span class="Operator">--</span><span class="Identifier">path</span><span class="Punctuation">:</span><span class="Identifier">somePath</span> <span class="Comment"># same as switch(&quot;path&quot;, &quot;somePath&quot;)</span>
  920. <span class="Operator">--</span><span class="Identifier">path</span><span class="Punctuation">:</span><span class="StringLit">&quot;someOtherPath&quot;</span> <span class="Comment"># same as switch(&quot;path&quot;, &quot;someOtherPath&quot;)</span>
  921. <span class="Operator">--</span><span class="Identifier">hint</span><span class="Punctuation">:</span><span class="StringLit">&quot;[Conf]:off&quot;</span> <span class="Comment"># same as switch(&quot;hint&quot;, &quot;[Conf]:off&quot;)</span></pre></p>
  922. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L158" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  923. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L158" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  924. </dd>
  925. </div>
  926. <div id="--.t,untyped">
  927. <dt><pre><span class="Keyword">template</span> <a href="#--.t%2Cuntyped"><span class="Identifier">`--`</span></a><span class="Other">(</span><span class="Identifier">key</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a><span class="Other">)</span></pre></dt>
  928. <dd>
  929. <p>A shortcut for <a class="reference external" href="#switch,string,string">switch</a> Example:</p>
  930. <p><pre class="listing"><span class="Operator">--</span><span class="Identifier">listCmd</span> <span class="Comment"># same as switch(&quot;listCmd&quot;)</span></pre></p>
  931. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L168" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  932. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L168" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  933. </dd>
  934. </div>
  935. </div>
  936. <div id="task-templates-all">
  937. <div id="task.t,untyped,string,untyped">
  938. <dt><pre><span class="Keyword">template</span> <a href="#task.t%2Cuntyped%2Cstring%2Cuntyped"><span class="Identifier">task</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a><span class="Other">;</span> <span class="Identifier">description</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a></pre></dt>
  939. <dd>
  940. <p>Defines a task. Hidden tasks are supported via an empty description.</p>
  941. <p>Example:</p>
  942. <p><pre class="listing"><span class="Identifier">task</span> <span class="Identifier">build</span><span class="Punctuation">,</span> <span class="StringLit">&quot;default build is via the C backend&quot;</span><span class="Punctuation">:</span>
  943. <span class="Identifier">setCommand</span> <span class="StringLit">&quot;c&quot;</span></pre></p>
  944. <p>For a task named <tt class="docutils literal"><span class="pre"><span class="Identifier">foo</span></span></tt>, this template generates a <tt class="docutils literal"><span class="pre"><span class="Keyword">proc</span></span></tt> named <tt class="docutils literal"><span class="pre"><span class="Identifier">fooTask</span></span></tt>. This is useful if you need to call one task in another in your Nimscript.</p>
  945. <p>Example:</p>
  946. <p><pre class="listing"><span class="Identifier">task</span> <span class="Identifier">foo</span><span class="Punctuation">,</span> <span class="StringLit">&quot;foo&quot;</span><span class="Punctuation">:</span> <span class="Comment"># &gt; nim foo</span>
  947. <span class="Identifier">echo</span> <span class="StringLit">&quot;Running foo&quot;</span> <span class="Comment"># Running foo</span>
  948. <span class="Identifier">task</span> <span class="Identifier">bar</span><span class="Punctuation">,</span> <span class="StringLit">&quot;bar&quot;</span><span class="Punctuation">:</span> <span class="Comment"># &gt; nim bar</span>
  949. <span class="Identifier">echo</span> <span class="StringLit">&quot;Running bar&quot;</span> <span class="Comment"># Running bar</span>
  950. <span class="Identifier">fooTask</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Comment"># Running foo</span></pre></p>
  951. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L395" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  952. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L395" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  953. </dd>
  954. </div>
  955. </div>
  956. <div id="withDir-templates-all">
  957. <div id="withDir.t,string,untyped">
  958. <dt><pre><span class="Keyword">template</span> <a href="#withDir.t%2Cstring%2Cuntyped"><span class="Identifier">withDir</span></a><span class="Other">(</span><span class="Identifier">dir</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#untyped"><span class="Identifier">untyped</span></a></pre></dt>
  959. <dd>
  960. <p>Changes the current directory temporarily.</p>
  961. <p>If you need a permanent change, use the <a class="reference external" href="#cd,string">cd()</a> proc. Usage example:</p>
  962. <p><pre class="listing"><span class="Comment"># inside /some/path/</span>
  963. <span class="Identifier">withDir</span> <span class="StringLit">&quot;foo&quot;</span><span class="Punctuation">:</span>
  964. <span class="Comment"># move to /some/path/foo/</span>
  965. <span class="Comment"># back in /some/path/</span></pre></p>
  966. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L344" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  967. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L344" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  968. </dd>
  969. </div>
  970. </div>
  971. </dl>
  972. </div>
  973. </div>
  974. </div>
  975. <div class="twelve-columns footer">
  976. <span class="nim-sprite"></span>
  977. <br>
  978. <small style="color: var(--hint);">Made with Nim. Generated: 2025-01-09 12:00:25 UTC</small>
  979. </div>
  980. </div>
  981. </div>
  982. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  983. </body>
  984. </html>