1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255 |
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <!-- This file is generated by Nim. -->
- <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>system/nimscript</title>
- <!-- Google fonts -->
- <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
- <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
- <!-- Favicon -->
- <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=="/>
- <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=">
- <!-- CSS -->
- <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
- <!-- JS -->
- <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
- </head>
- <body>
- <div class="document" id="documentId">
- <div class="container">
- <h1 class="title">system/nimscript</h1>
- <div class="row">
- <div class="three columns">
- <div class="theme-select-wrapper">
- <label for="theme-select">Theme: </label>
- <select id="theme-select" onchange="setTheme(this.value)">
- <option value="auto">🌗 Match OS</option>
- <option value="dark">🌑 Dark</option>
- <option value="light">🌕 Light</option>
- </select>
- </div>
- <div id="global-links">
- <ul class="simple-boot">
- <li><a href="manual.html">Manual</a></li>
- <li><a href="lib.html">Standard library</a></li>
- <li> <a id="indexLink" href="theindex.html">Index</a></li>
- <li><a href="compiler/theindex.html">Compiler docs</a></li>
- <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
- <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
- </ul>
- </div>
- <div id="searchInputDiv">
- Search: <input type="search" id="searchInput"
- oninput="search()" />
- </div>
-
- <ul class="simple simple-toc" id="toc-list">
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#ScriptMode" title="ScriptMode {.pure.} = enum
- Silent, ## Be silent.
- Verbose, ## Be verbose.
- Whatif ## Do not run commands, instead just echo what
- ## would have been done.">ScriptMode</a></li>
- </ul>
- </details>
- </li>
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#8" id="58">Vars</a></summary>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#author" title="author: string">author</a></li>
- <li><a class="reference" href="#backend" title="backend: string">backend</a></li>
- <li><a class="reference" href="#bin" title="bin: seq[string] = @[]">bin</a></li>
- <li><a class="reference" href="#binDir" title="binDir: string">binDir</a></li>
- <li><a class="reference" href="#description" title="description: string">description</a></li>
- <li><a class="reference" href="#installDirs" title="installDirs: seq[string] = @[]">installDirs</a></li>
- <li><a class="reference" href="#installExt" title="installExt: seq[string] = @[]">installExt</a></li>
- <li><a class="reference" href="#installFiles" title="installFiles: seq[string] = @[]">installFiles</a></li>
- <li><a class="reference" href="#license" title="license: string">license</a></li>
- <li><a class="reference" href="#mode" title="mode: ScriptMode">mode</a></li>
- <li><a class="reference" href="#packageName" title="packageName = """>packageName</a></li>
- <li><a class="reference" href="#requiresData" title="requiresData: seq[string] = @[]">requiresData</a></li>
- <li><a class="reference" href="#skipDirs" title="skipDirs: seq[string] = @[]">skipDirs</a></li>
- <li><a class="reference" href="#skipExt" title="skipExt: seq[string] = @[]">skipExt</a></li>
- <li><a class="reference" href="#skipFiles" title="skipFiles: seq[string] = @[]">skipFiles</a></li>
- <li><a class="reference" href="#srcDir" title="srcDir: string">srcDir</a></li>
- <li><a class="reference" href="#version" title="version: string">version</a></li>
- </ul>
- </details>
- </li>
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#buildCPU" title="buildCPU {.magic: "BuildCPU".}: string = """>buildCPU</a></li>
- <li><a class="reference" href="#buildOS" title="buildOS {.magic: "BuildOS".}: string = """>buildOS</a></li>
- </ul>
- </details>
- </li>
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
- <ul class="simple simple-toc-section">
- <ul class="simple nested-toc-section">cd
- <li><a class="reference" href="#cd%2Cstring" title="cd(dir: string)">cd(dir: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">cmpic
- <li><a class="reference" href="#cmpic%2Cstring%2Cstring" title="cmpic(a, b: string): int">cmpic(a, b: string): int</a></li>
- </ul>
- <ul class="simple nested-toc-section">cpDir
- <li><a class="reference" href="#cpDir%2Cstring%2Cstring" title="cpDir(from, to: string)">cpDir(from, to: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">cpFile
- <li><a class="reference" href="#cpFile%2Cstring%2Cstring" title="cpFile(from, to: string)">cpFile(from, to: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">cppDefine
- <li><a class="reference" href="#cppDefine%2Cstring" title="cppDefine(define: string)">cppDefine(define: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">delEnv
- <li><a class="reference" href="#delEnv%2Cstring" title="delEnv(key: string)">delEnv(key: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">dirExists
- <li><a class="reference" href="#dirExists%2Cstring" title="dirExists(dir: string): bool">dirExists(dir: string): bool</a></li>
- </ul>
- <ul class="simple nested-toc-section">exec
- <li><a class="reference" href="#exec%2Cstring" title="exec(command: string)">exec(command: string)</a></li>
- <li><a class="reference" href="#exec%2Cstring%2Cstring%2Cstring" title="exec(command: string; input: string; cache = "")">exec(command: string; input: string; cache = "")</a></li>
- </ul>
- <ul class="simple nested-toc-section">exists
- <li><a class="reference" href="#exists%2Cstring" title="exists(key: string): bool">exists(key: string): bool</a></li>
- </ul>
- <ul class="simple nested-toc-section">existsEnv
- <li><a class="reference" href="#existsEnv%2Cstring" title="existsEnv(key: string): bool">existsEnv(key: string): bool</a></li>
- </ul>
- <ul class="simple nested-toc-section">fileExists
- <li><a class="reference" href="#fileExists%2Cstring" title="fileExists(filename: string): bool">fileExists(filename: string): bool</a></li>
- </ul>
- <ul class="simple nested-toc-section">findExe
- <li><a class="reference" href="#findExe%2Cstring" title="findExe(bin: string): string">findExe(bin: string): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">get
- <li><a class="reference" href="#get%2Cstring" title="get(key: string): string">get(key: string): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">getCommand
- <li><a class="reference" href="#getCommand" title="getCommand(): string">getCommand(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">getCurrentDir
- <li><a class="reference" href="#getCurrentDir" title="getCurrentDir(): string">getCurrentDir(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">getEnv
- <li><a class="reference" href="#getEnv%2Cstring%2Cstring" title="getEnv(key: string; default = ""): string">getEnv(key: string; default = ""): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">hint
- <li><a class="reference" href="#hint%2Cstring%2Cbool" title="hint(name: string; val: bool)">hint(name: string; val: bool)</a></li>
- </ul>
- <ul class="simple nested-toc-section">listDirs
- <li><a class="reference" href="#listDirs%2Cstring" title="listDirs(dir: string): seq[string]">listDirs(dir: string): seq[string]</a></li>
- </ul>
- <ul class="simple nested-toc-section">listFiles
- <li><a class="reference" href="#listFiles%2Cstring" title="listFiles(dir: string): seq[string]">listFiles(dir: string): seq[string]</a></li>
- </ul>
- <ul class="simple nested-toc-section">mkDir
- <li><a class="reference" href="#mkDir%2Cstring" title="mkDir(dir: string)">mkDir(dir: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">mvDir
- <li><a class="reference" href="#mvDir%2Cstring%2Cstring" title="mvDir(from, to: string)">mvDir(from, to: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">mvFile
- <li><a class="reference" href="#mvFile%2Cstring%2Cstring" title="mvFile(from, to: string)">mvFile(from, to: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">nimcacheDir
- <li><a class="reference" href="#nimcacheDir" title="nimcacheDir(): string">nimcacheDir(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">paramCount
- <li><a class="reference" href="#paramCount" title="paramCount(): int">paramCount(): int</a></li>
- </ul>
- <ul class="simple nested-toc-section">paramStr
- <li><a class="reference" href="#paramStr%2Cint" title="paramStr(i: int): string">paramStr(i: int): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">patchFile
- <li><a class="reference" href="#patchFile%2Cstring%2Cstring%2Cstring" title="patchFile(package, filename, replacement: string)">patchFile(package, filename, replacement: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">projectDir
- <li><a class="reference" href="#projectDir" title="projectDir(): string">projectDir(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">projectName
- <li><a class="reference" href="#projectName" title="projectName(): string">projectName(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">projectPath
- <li><a class="reference" href="#projectPath" title="projectPath(): string">projectPath(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">put
- <li><a class="reference" href="#put%2Cstring%2Cstring" title="put(key, value: string)">put(key, value: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">putEnv
- <li><a class="reference" href="#putEnv%2Cstring%2Cstring" title="putEnv(key, val: string)">putEnv(key, val: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">readAllFromStdin
- <li><a class="reference" href="#readAllFromStdin" title="readAllFromStdin(): string">readAllFromStdin(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">readLineFromStdin
- <li><a class="reference" href="#readLineFromStdin" title="readLineFromStdin(): string">readLineFromStdin(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">requires
- <li><a class="reference" href="#requires%2Cvarargs%5Bstring%5D" title="requires(deps: varargs[string])">requires(deps: varargs[string])</a></li>
- </ul>
- <ul class="simple nested-toc-section">rmDir
- <li><a class="reference" href="#rmDir%2Cstring" title="rmDir(dir: string; checkDir = false)">rmDir(dir: string; checkDir = false)</a></li>
- </ul>
- <ul class="simple nested-toc-section">rmFile
- <li><a class="reference" href="#rmFile%2Cstring" title="rmFile(file: string)">rmFile(file: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">selfExe
- <li><a class="reference" href="#selfExe" title="selfExe(): string">selfExe(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">selfExec
- <li><a class="reference" href="#selfExec%2Cstring" title="selfExec(command: string)">selfExec(command: string)</a></li>
- </ul>
- <ul class="simple nested-toc-section">setCommand
- <li><a class="reference" href="#setCommand%2Cstring%2Cstring" title="setCommand(cmd: string; project = "")">setCommand(cmd: string; project = "")</a></li>
- </ul>
- <ul class="simple nested-toc-section">switch
- <li><a class="reference" href="#switch%2Cstring%2Cstring" title="switch(key: string; val = "")">switch(key: string; val = "")</a></li>
- </ul>
- <ul class="simple nested-toc-section">thisDir
- <li><a class="reference" href="#thisDir" title="thisDir(): string">thisDir(): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">toDll
- <li><a class="reference" href="#toDll%2Cstring" title="toDll(filename: string): string">toDll(filename: string): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">toExe
- <li><a class="reference" href="#toExe%2Cstring" title="toExe(filename: string): string">toExe(filename: string): string</a></li>
- </ul>
- <ul class="simple nested-toc-section">warning
- <li><a class="reference" href="#warning%2Cstring%2Cbool" title="warning(name: string; val: bool)">warning(name: string; val: bool)</a></li>
- </ul>
- </ul>
- </details>
- </li>
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
- <ul class="simple simple-toc-section">
- <ul class="simple nested-toc-section">--
- <li><a class="reference" href="#--.t%2Cuntyped%2Cuntyped" title="`--`(key, val: untyped)">`--`(key, val: untyped)</a></li>
- <li><a class="reference" href="#--.t%2Cuntyped" title="`--`(key: untyped)">`--`(key: untyped)</a></li>
- </ul>
- <ul class="simple nested-toc-section">task
- <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>
- </ul>
- <ul class="simple nested-toc-section">withDir
- <li><a class="reference" href="#withDir.t%2Cstring%2Cuntyped" title="withDir(dir: string; body: untyped): untyped">withDir(dir: string; body: untyped): untyped</a></li>
- </ul>
- </ul>
- </details>
- </li>
- </ul>
- </div>
- <div class="nine columns" id="content">
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L1" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
- <div id="tocRoot"></div>
-
- <p class="module-desc">To learn about scripting in Nim see <a class="reference external" href="nims.html">NimScript</a></p>
- <div class="section" id="7">
- <h1><a class="toc-backref" href="#7">Types</a></h1>
- <dl class="item">
- <div id="ScriptMode">
- <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>
- <span class="Identifier">Silent</span><span class="Other">,</span> <span class="Comment">## Be silent.</span>
- <span class="Identifier">Verbose</span><span class="Other">,</span> <span class="Comment">## Be verbose.</span>
- <span class="Identifier">Whatif</span> <span class="Comment">## Do not run commands, instead just echo what</span>
- <span class="Comment">## would have been done.</span></pre></dt>
- <dd>
-
- Controls the behaviour of the script.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L177" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L177" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </dl>
- </div>
- <div class="section" id="8">
- <h1><a class="toc-backref" href="#8">Vars</a></h1>
- <dl class="item">
- <div id="author">
- <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>
- <dd>
-
- Nimble support: The package's author.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L435" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L435" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="backend">
- <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>
- <dd>
-
- Nimble support: The package's backend.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L440" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L440" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="bin">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="binDir">
- <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>
- <dd>
-
- Nimble support: The package's binary directory.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L439" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L439" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="description">
- <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>
- <dd>
-
- Nimble support: The package's description.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L436" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L436" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="installDirs">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="installExt">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="installFiles">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="license">
- <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>
- <dd>
-
- Nimble support: The package's license.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L437" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L437" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="mode">
- <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>
- <dd>
-
- Set this to influence how mkDir, rmDir, rmFile etc. behave
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L184" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L184" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="packageName">
- <dt><pre><a href="nimscript.html#packageName"><span class="Identifier">packageName</span></a> <span class="Other">=</span> <span class="StringLit">""</span></pre></dt>
- <dd>
-
- Nimble support: Set this to the package name. It is usually not required to do that, nims' filename is the default.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L431" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="requiresData">
- <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>
- <dd>
-
- Exposes the list of requirements for read and write accesses.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L444" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L444" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="skipDirs">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="skipExt">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="skipFiles">
- <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>
- <dd>
-
-
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L442" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="srcDir">
- <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>
- <dd>
-
- Nimble support: The package's source directory.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L438" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L438" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="version">
- <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>
- <dd>
-
- Nimble support: The package's version.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L434" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L434" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </dl>
- </div>
- <div class="section" id="10">
- <h1><a class="toc-backref" href="#10">Consts</a></h1>
- <dl class="item">
- <div id="buildCPU">
- <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">"BuildCPU"</span>.}<span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Other">=</span> <span class="StringLit">""</span></pre></dt>
- <dd>
-
- 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.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L20" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L20" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="buildOS">
- <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">"BuildOS"</span>.}<span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> <span class="Other">=</span> <span class="StringLit">""</span></pre></dt>
- <dd>
-
- 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.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L16" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L16" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </dl>
- </div>
- <div class="section" id="12">
- <h1><a class="toc-backref" href="#12">Procs</a></h1>
- <dl class="item">
- <div id="cd-procs-all">
- <div id="cd,string">
- <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>
- <dd>
-
- <p>Changes the current directory.</p>
- <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>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L328" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L328" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="cmpic-procs-all">
- <div id="cmpic,string,string">
- <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>
- <dd>
-
- 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.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L110" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L110" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="cpDir-procs-all">
- <div id="cpDir,string,string">
- <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>
- <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>
- <dd>
-
- 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>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L247" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L247" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="cpFile-procs-all">
- <div id="cpFile,string,string">
- <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>
- <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>
- <dd>
-
- 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>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L241" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L241" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="cppDefine-procs-all">
- <div id="cppDefine,string">
- <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>
- <dd>
-
- 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.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L368" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L368" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="delEnv-procs-all">
- <div id="delEnv,string">
- <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>
- <dd>
-
- Deletes the environment variable named <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L126" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L126" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="dirExists-procs-all">
- <div id="dirExists,string">
- <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>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Checks if the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt> exists.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L134" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L134" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="exec-procs-all">
- <div id="exec,string">
- <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>
- <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>
- <dd>
-
- 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>
- 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>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L253" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L253" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="exec,string,string,string">
- <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">""</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>
- <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>
- <dd>
-
- 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>
- 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>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L267" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L267" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="exists-procs-all">
- <div id="exists,string">
- <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>
- <dd>
-
- Checks for the existence of a configuration 'key' like 'gcc.options.always'.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L301" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L301" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="existsEnv-procs-all">
- <div id="existsEnv,string">
- <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>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Checks for the existence of an environment variable named <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L118" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L118" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fileExists-procs-all">
- <div id="fileExists,string">
- <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>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Checks if the file exists.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L130" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L130" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="findExe-procs-all">
- <div id="findExe,string">
- <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>
- <dd>
-
- Searches for bin in the current working directory and then in directories listed in the PATH environment variable. Returns "" if the exe cannot be found.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L338" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L338" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="get-procs-all">
- <div id="get,string">
- <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>
- <dd>
-
- Retrieves a configuration 'key' like 'gcc.options.always'.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L297" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L297" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="getCommand-procs-all">
- <div id="getCommand">
- <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>
- <dd>
-
- Gets the Nim command that the compiler has been invoked with, for example "c", "js", "build", "help".
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L97" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L97" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="getCurrentDir-procs-all">
- <div id="getCurrentDir">
- <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>
- <dd>
-
- Retrieves the current working directory.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L50" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L50" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="getEnv-procs-all">
- <div id="getEnv,string,string">
- <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">""</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>
- <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>
- <dd>
-
- Retrieves the environment variable of name <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L114" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L114" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="hint-procs-all">
- <div id="hint,string,bool">
- <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>
- <dd>
-
- Disables or enables a specific hint.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L77" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L77" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="listDirs-procs-all">
- <div id="listDirs,string">
- <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>
- <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>
- <dd>
-
- Lists all the subdirectories (non-recursively) in the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L200" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L200" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="listFiles-procs-all">
- <div id="listFiles,string">
- <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>
- <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>
- <dd>
-
- Lists all the files (non-recursively) in the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L205" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L205" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="mkDir-procs-all">
- <div id="mkDir,string">
- <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>
- <dd>
-
- 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.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L222" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L222" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="mvDir-procs-all">
- <div id="mvDir,string,string">
- <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>
- <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>
- <dd>
-
- 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>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L235" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L235" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="mvFile-procs-all">
- <div id="mvFile,string,string">
- <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>
- <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>
- <dd>
-
- 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>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L229" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L229" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="nimcacheDir-procs-all">
- <div id="nimcacheDir">
- <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>
- <dd>
-
- Retrieves the location of 'nimcache'.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L306" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L306" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="paramCount-procs-all">
- <div id="paramCount">
- <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>
- <dd>
-
- Retrieves the number of command line parameters.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L63" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L63" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="paramStr-procs-all">
- <div id="paramStr,int">
- <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>
- <dd>
-
- Retrieves the <tt class="docutils literal"><span class="pre"><span class="Identifier">i</span></span></tt>'th command line parameter.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L59" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L59" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="patchFile-procs-all">
- <div id="patchFile,string,string,string">
- <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>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- <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>
- <p>Example:</p>
- <p><pre class="listing"><span class="Identifier">patchFile</span><span class="Punctuation">(</span><span class="StringLit">"stdlib"</span><span class="Punctuation">,</span> <span class="StringLit">"asyncdispatch"</span><span class="Punctuation">,</span> <span class="StringLit">"patches/replacement"</span><span class="Punctuation">)</span></pre></p>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L82" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L82" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="projectDir-procs-all">
- <div id="projectDir">
- <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>
- <dd>
-
- Retrieves the absolute directory of the current project
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L314" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L314" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="projectName-procs-all">
- <div id="projectName">
- <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>
- <dd>
-
- Retrieves the name of the current project
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L310" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L310" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="projectPath-procs-all">
- <div id="projectPath">
- <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>
- <dd>
-
- Retrieves the absolute path of the current project
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L318" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L318" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="put-procs-all">
- <div id="put,string,string">
- <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>
- <dd>
-
- Sets a configuration 'key' like 'gcc.options.always' to its value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L293" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L293" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="putEnv-procs-all">
- <div id="putEnv,string,string">
- <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>
- <dd>
-
- 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>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L122" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L122" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="readAllFromStdin-procs-all">
- <div id="readAllFromStdin">
- <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>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Reads all data from stdin - blocks until EOF which happens when stdin is closed
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L387" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L387" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="readLineFromStdin-procs-all">
- <div id="readLineFromStdin">
- <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>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Reads a line of data from stdin - blocks until n or EOF which happens when stdin is closed
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L381" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L381" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="requires-procs-all">
- <div id="requires,varargs[string]">
- <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>
- <dd>
-
- Nimble support: Call this to set the list of requirements of your Nimble package.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L447" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L447" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="rmDir-procs-all">
- <div id="rmDir,string">
- <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>
- <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>
- <dd>
-
- Removes the directory <tt class="docutils literal"><span class="pre"><span class="Identifier">dir</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L210" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L210" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="rmFile-procs-all">
- <div id="rmFile,string">
- <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>
- <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>
- <dd>
-
- Removes the <tt class="docutils literal"><span class="pre"><span class="Identifier">file</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L216" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L216" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="selfExe-procs-all">
- <div id="selfExe">
- <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">"Deprecated since v1.7; Use getCurrentCompilerExe"</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">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>
- <dd>
- <div class="deprecation-message">
- <b>Deprecated:</b> Deprecated since v1.7; Use getCurrentCompilerExe
- </div>
- Returns the currently running nim or nimble executable.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L139" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L139" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="selfExec-procs-all">
- <div id="selfExec,string">
- <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>
- <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>
- <dd>
-
- 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 "nim " part.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L283" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L283" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="setCommand-procs-all">
- <div id="setCommand,string,string">
- <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">""</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>
- <dd>
-
- Sets the Nim command that should be continued with after this Nimscript has finished.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L102" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L102" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="switch-procs-all">
- <div id="switch,string,string">
- <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">""</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>
- <dd>
-
- 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">"checks"</span><span class="Punctuation">,</span> <span class="StringLit">"on"</span><span class="Punctuation">)</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L67" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L67" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="thisDir-procs-all">
- <div id="thisDir">
- <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>
- <dd>
-
- 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>).
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L322" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L322" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="toDll-procs-all">
- <div id="toDll,string">
- <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>
- <dd>
-
- On Windows adds ".dll" to <tt class="docutils literal"><span class="pre"><span class="Identifier">filename</span></span></tt>, on Posix produces "lib$filename.so".
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L147" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L147" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="toExe-procs-all">
- <div id="toExe,string">
- <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>
- <dd>
-
- On Windows adds ".exe" 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.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L143" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L143" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="warning-procs-all">
- <div id="warning,string,bool">
- <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>
- <dd>
-
- Disables or enables a specific warning.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L72" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L72" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- </dl>
- </div>
- <div class="section" id="18">
- <h1><a class="toc-backref" href="#18">Templates</a></h1>
- <dl class="item">
- <div id="---templates-all">
- <div id="--.t,untyped,untyped">
- <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>
- <dd>
-
- <p>A shortcut for <a class="reference external" href="#switch,string,string">switch</a> Example:</p>
- <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("path", "somePath")</span>
- <span class="Operator">--</span><span class="Identifier">path</span><span class="Punctuation">:</span><span class="StringLit">"someOtherPath"</span> <span class="Comment"># same as switch("path", "someOtherPath")</span>
- <span class="Operator">--</span><span class="Identifier">hint</span><span class="Punctuation">:</span><span class="StringLit">"[Conf]:off"</span> <span class="Comment"># same as switch("hint", "[Conf]:off")</span></pre></p>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L158" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L158" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="--.t,untyped">
- <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>
- <dd>
-
- <p>A shortcut for <a class="reference external" href="#switch,string,string">switch</a> Example:</p>
- <p><pre class="listing"><span class="Operator">--</span><span class="Identifier">listCmd</span> <span class="Comment"># same as switch("listCmd")</span></pre></p>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L168" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L168" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="task-templates-all">
- <div id="task.t,untyped,string,untyped">
- <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>
- <dd>
-
- <p>Defines a task. Hidden tasks are supported via an empty description.</p>
- <p>Example:</p>
- <p><pre class="listing"><span class="Identifier">task</span> <span class="Identifier">build</span><span class="Punctuation">,</span> <span class="StringLit">"default build is via the C backend"</span><span class="Punctuation">:</span>
- <span class="Identifier">setCommand</span> <span class="StringLit">"c"</span></pre></p>
- <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>
- <p>Example:</p>
- <p><pre class="listing"><span class="Identifier">task</span> <span class="Identifier">foo</span><span class="Punctuation">,</span> <span class="StringLit">"foo"</span><span class="Punctuation">:</span> <span class="Comment"># > nim foo</span>
- <span class="Identifier">echo</span> <span class="StringLit">"Running foo"</span> <span class="Comment"># Running foo</span>
- <span class="Identifier">task</span> <span class="Identifier">bar</span><span class="Punctuation">,</span> <span class="StringLit">"bar"</span><span class="Punctuation">:</span> <span class="Comment"># > nim bar</span>
- <span class="Identifier">echo</span> <span class="StringLit">"Running bar"</span> <span class="Comment"># Running bar</span>
- <span class="Identifier">fooTask</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Comment"># Running foo</span></pre></p>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L395" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L395" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="withDir-templates-all">
- <div id="withDir.t,string,untyped">
- <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>
- <dd>
-
- <p>Changes the current directory temporarily.</p>
- <p>If you need a permanent change, use the <a class="reference external" href="#cd,string">cd()</a> proc. Usage example:</p>
- <p><pre class="listing"><span class="Comment"># inside /some/path/</span>
- <span class="Identifier">withDir</span> <span class="StringLit">"foo"</span><span class="Punctuation">:</span>
- <span class="Comment"># move to /some/path/foo/</span>
- <span class="Comment"># back in /some/path/</span></pre></p>
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/nimscript.nim#L344" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L344" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- </dl>
- </div>
- </div>
- </div>
- <div class="twelve-columns footer">
- <span class="nim-sprite"></span>
- <br>
- <small style="color: var(--hint);">Made with Nim. Generated: 2025-01-09 12:00:25 UTC</small>
- </div>
- </div>
- </div>
- <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
-
- </body>
- </html>
|