From: Mike Frysinger Date: Sun, 26 Jan 2020 20:17:03 +0000 (-0500) Subject: add a dist helper X-Git-Tag: v0.3~15 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f458d903e81977e24471d802452db8b957d5a055;p=chrome-ext%2Ftabs-backup.git add a dist helper --- diff --git a/makedist.sh b/makedist.sh new file mode 100755 index 0000000..fdfc98c --- /dev/null +++ b/makedist.sh @@ -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"