-
-
Save singularperturbation/317b5439c4f3e4c78d62523a10eb72f4 to your computer and use it in GitHub Desktop.
Read version (or other info) at compile time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import strutils | |
| template getPath(): string = | |
| const path = instantiationInfo(fullPaths = true) | |
| splitFile(path.filename).dir & DirSep | |
| const versionFile = getPath() & "version.txt" | |
| const version = slurp(versionFile).strip() | |
| echo version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.2.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment