-
Notifications
You must be signed in to change notification settings - Fork 0
/
reshape.nimble
41 lines (36 loc) · 1.2 KB
/
reshape.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
# vim: ft=config
import strformat
version = "0.4.2"
author = "adigitoleo"
description = "Reshape a delimited text file"
license = "0BSD"
requires "nim >= 1.4.8"
requires "unittest2" # https://github.com/status-im/nim-unittest2
srcdir = "src"
bindir = "build/bin"
bin = @["reshape"]
task release, "Create release commit and tag":
let name = projectName()
try:
exec "test $(git describe --abbrev=0) != v{version}".fmt
except OSError:
echo "Aborted: v{version} tag already exists.".fmt
quit(1)
echo "Tagging {name} version {version}:".fmt
echo "Checking git branch..."
try:
exec "test $(git symbolic-ref HEAD) = refs/heads/main"
except OSError:
echo "Aborted: must be on main branch to tag a new version."
quit(1)
echo "Checking git status..."
try:
exec "test \"$(git status --porcelain)\" = 'M {name}.nimble'".fmt
except OSError:
echo "Aborted: should (only) have modified (and added) nimble file."
quit(1)
echo "Creating release commit..."
exec "git commit -m'release: Version {version}'".fmt
echo "Creating release tag..."
exec "git tag -a v{version} -m'Version {version}'".fmt
echo "Done."