]> git.wh0rd.org Git - chrome-ext/tabs-backup.git/commitdiff
add a dist helper
authorMike Frysinger <vapier@gentoo.org>
Sun, 26 Jan 2020 20:17:03 +0000 (15:17 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 26 Jan 2020 20:19:22 +0000 (15:19 -0500)
makedist.sh [new file with mode: 0755]

diff --git a/makedist.sh b/makedist.sh
new file mode 100755 (executable)
index 0000000..fdfc98c
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash -e
+
+json_value() {
+  local key=$1
+  python -c '
+import json, os, sys
+path, key = sys.argv[1:]
+with open(path) as fp:
+  data = json.load(fp)
+print(data[key])
+' "manifest.json" "${key}"
+}
+
+PN=$(json_value name | sed 's:[[:space:]/]:_:g' | tr '[:upper:]' '[:lower:]')
+PV=$(json_value version)
+P="${PN}-${PV}"
+
+rm -rf "${P}"
+mkdir "${P}"
+
+cp -r *.css *.html *.js *.json *.png img "${P}"/
+zip="${P}.zip"
+rm -f "${zip}"
+zip -r "${zip}" "${P}"
+rm -rf "${P}"
+du -b "${zip}"
+
+echo "https://chrome.google.com/webstore/devconsole/g08715941841440123102/ojcidmfgknjffgginmfeakngnegjkaca/edit/package"