]> git.armaanb.net Git - lightcards.git/commitdiff
Changing version in setup.py changes everywhere
authorArmaan Bhojwani <me@armaanb.net>
Fri, 12 Feb 2021 00:18:18 +0000 (19:18 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Fri, 12 Feb 2021 00:18:18 +0000 (19:18 -0500)
contrib/manconvert
contrib/version-switch [deleted file]
lightcards/runner.py
man/lightcards.1.md

index 65536378964ea87b21cb7b93de4eb41d2adbb165..8c4afbfd28466116e399b19cb024a2e3dcaed737 100755 (executable)
@@ -1,4 +1,7 @@
 #!/usr/bin/env sh
-for i in man/*; do
-  pandoc ${i} -s -t man -o $(echo ${i} | cut -d '.' -f -2)
+find man/*.md | \
+while read i; do
+  base=$(echo ${i} | cut -d '.' -f -2)
+  pandoc ${i} -s -t man -o ${base}
+  sed -i "s/VERSION_HERE/$(python3 -m lightcards -v)/g" ${base}
 done
diff --git a/contrib/version-switch b/contrib/version-switch
deleted file mode 100755 (executable)
index 7f92a2a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env sh
-current=$(git tag | tail -n 1 | tail -c +2)
-grep -rl --exclude-dir=.git ${current} | \
-  while read line; do
-    sed -i "s/${current}/${1}/g" ${line}
-  done
index 35651f92b5fd1d20cb7454b9bc1e1f34c661d1e6..f9f1abd9437d5f430bd7e6da721fc0562beb2b76 100644 (file)
@@ -4,6 +4,7 @@
 import argparse
 from curses import wrapper
 import os
+import pkg_resources
 from random import shuffle
 import sys
 
@@ -40,7 +41,10 @@ def parse_args():
         "-s", "--shuffle", action="store_true", help="shuffle card order"
     )
     parser.add_argument(
-        "-v", "--version", action="version", version="lightcards 0.6.0"
+        "-v",
+        "--version",
+        action="version",
+        version=f"lightcards {pkg_resources.require('lightcards')[0].version}",
     )
     return parser.parse_args()
 
index d3813f603d8d6fa87d27aa6e183eb38f49fc43be..96b62ee0a7a5f94b1d3c3768d1d2c5d8adec63d7 100644 (file)
@@ -2,7 +2,7 @@
 title: lightcards
 section: 1
 header: General Commands Manual
-footer: lightcards 0.6.0
+footer: VERSION_HERE
 date: February 2021
 ---