diff options
-rw-r--r-- | manifest.json | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rwxr-xr-x | script/package.sh | 20 |
3 files changed, 22 insertions, 2 deletions
diff --git a/manifest.json b/manifest.json index 59c44fe..c5989ac 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Vim Vixen", "description": "Vim Vixen", - "version": "0.9", + "version": "0.10", "icons": { "48": "resources/icon_48x48.png", "96": "resources/icon_96x96.png" diff --git a/package.json b/package.json index 368a4ec..6395a21 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "start": "webpack -w --debug --devtool inline-source-map", "build": "NODE_ENV=production webpack --progress --display-error-details", - "package": "npm run build && node script/package.js", + "package": "npm run build && script/package.sh", "lint": "eslint --ext .jsx,.js src", "test": "karma start" }, 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 |