aboutsummaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-01-20 23:40:26 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-01-20 23:40:26 +0900
commitc0d11106ab67b5b18eddc453c8fce8c197957d04 (patch)
tree28222e480f43347b07d6f0d877104a2f1866315f /script
parent9614ec11fda0ed3ab5ed5cbb92de0d930a09edc1 (diff)
revert package.sh
Diffstat (limited to 'script')
-rwxr-xr-xscript/package.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/script/package.sh b/script/package.sh
new file mode 100755
index 0000000..34535ba
--- /dev/null
+++ b/script/package.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+MANIFEST="manifest.json"
+
+version=$(jq -r '.version' $MANIFEST)
+
+icons=$(jq -r '.icons[]' $MANIFEST)
+content_scripts=$(jq -r '.content_scripts[].js[]' $MANIFEST)
+background_scripts=$(jq -r '.background.scripts[]' $MANIFEST)
+web_accessible_resources=$(jq -r '.web_accessible_resources[]' $MANIFEST)
+options_ui=$(jq -r '.options_ui.page' $MANIFEST)
+options_scripts=""
+for html in $options_ui; do
+ scripts=$(grep -Po "(?<=src=['\"])[^'\"]*" "$html")
+ for js in $scripts; do
+ options_scripts="$options_scripts $(dirname $html)/$js"
+ done
+done
+
+zip ${version}.zip $MANIFEST $icons $content_scripts $background_scripts $web_accessible_resources $options_ui $options_scripts