Verified Commit 293397fb authored by Marco Kellershoff's avatar Marco Kellershoff 🤸
Browse files

Major rework

parent 22a5179f
yarn-offline-mirror "./.vendor/npm"
yarn-offline-mirror-pruning true
#!/bin/bash
NBIN="./node_modules/.bin"
function __show_tasks {
compgen -A function | grep -v "^_"
}
function start {
docker-compose -p gorillawriter up -d
}
function stop {
docker-compose -p gorillawriter down
}
function help {
echo "$0 <task> <args>"
echo "Tasks:"
tasks | cat -n
}
function tasks {
compgen -A function
}
function minify {
$NBIN/babel-minify \
./src/background.js \
--out-file ./dist/background.js
$NBIN/babel-minify \
./src/boot.js \
--out-file ./dist/boot.js
$NBIN/babel-minify \
./src/options.js \
--out-file ./dist/options.js
}
function clean {
rm -rf ./dist/*
}
function devbuild {
clean
cp -r src/_locales \
src/icons \
src/background.js \
src/boot.js \
src/manifest.json \
src/options.{js,html} \
dist/
sass ./src/options.scss:./dist/options.css --style compressed
minify
}
function _packup {
local version
version=$(jq -r .version < ./dist/manifest.json)
pushd dist || exit && zip -r ../dist-$version.zip ./* && popd || exit
}
function build {
devbuild && minify && _packup
}
function watch {
local watchdir="./src/"
_logger "Watcher started"
inotifywait -m -r -e close_write --format '%w%f' "${watchdir}" | \
while read -r _; do
_logger "Build triggered"
build
_logger "Build finished"
done
}
function default {
tasks
}
"${@:-default}"
*
!.gitignore
{
"dependencies": {
"babel-minify": "^0.5.0"
}
}
......@@ -54,6 +54,15 @@
});
getDataStoreKey("injectionActive", false, (injectionActive) => {
injectEverything(injectionActive);
getDataStoreKey("hostnames", [], (hostnames) => {
const len = hostnames.length;
let i = len - 1;
for (; i >= 0; i--) {
if (window.location.hostname === hostnames[i]) {
injectEverything(injectionActive);
break;
}
}
});
});
})();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment