passphrase/passphrase.nimble

38 lines
904 B
Plaintext
Raw Normal View History

2021-07-26 13:48:01 +00:00
# Package
2021-07-29 00:10:39 +00:00
version = "0.4.0"
2021-07-26 13:48:01 +00:00
author = "Joseph Montanaro"
description = "Passphrase generator and dictionary builder"
license = "none"
srcDir = "src"
bin = @["passphrase"]
# Dependencies
requires "nim >= 1.0"
requires "nimcrypto >= 0.4.8"
# Tasks n scripts
proc runCmd(command: string, input = "", cache = ""): string =
let (output, exitCode) = gorgeEx(command, input, cache)
if exitCode != 0:
echo "Command failed: " & command
echo "Output:\n ", output.splitLines().join("\n ")
quit(exitCode)
result = output
task(dictionary, "Generate dictionary from BNC XML files"):
echo "Building dictionary"
2021-07-29 00:01:49 +00:00
let output = runCmd("nim c --run --threads:on -d:release -d:lto src/process.nim data/BNC/2554/download/Texts src/")
2021-07-27 03:54:13 +00:00
echo output.strip().splitlines()[^1]
2021-07-26 13:48:01 +00:00
before(build):
2021-07-29 00:01:49 +00:00
if not fileExists("data/dictionary.txt"):
2021-07-26 13:48:01 +00:00
dictionaryTask()