-
Notifications
You must be signed in to change notification settings - Fork 8
/
lrucache.nimble
44 lines (35 loc) · 1.08 KB
/
lrucache.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Package
version = "1.1.4"
author = "Jack Tang"
description = "Least recently used (LRU) cache"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 1.0.0"
proc updateNimbleVersion(ver: string) =
let fname = "lrucache.nimble"
let txt = readFile(fname)
var lines = txt.split("\n")
for i, line in lines:
if line.startsWith("version"):
let s = line.find('"')
let e = line.find('"', s+1)
lines[i] = line[0..s] & ver & line[e..<line.len]
break
writeFile(fname, lines.join("\n"))
task version, "update version":
# last params as version
let ver = paramStr( paramCount() )
if ver == "version":
echo version
else:
withDir thisDir():
updateNimbleVersion(ver)
task docgen, "generate docs":
exec "nim doc --out:docs/index.html src/lrucache.nim"
task release_patch, "release with patch increment":
exec "release-it --ci -i patch"
task release_minor, "releaes with minor increment":
exec "release-it --ci -i minor"
task release_major, "release with major increment":
exec "release-it --ci -i major"