From f458d903e81977e24471d802452db8b957d5a055 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 26 Jan 2020 15:17:03 -0500 Subject: [PATCH] add a dist helper --- makedist.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 makedist.sh 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" -- 2.39.5