Skip to content

Commit 92863f8

Browse files
chore(package.json): Add fix:file cmd for dealing with wrong origins
1 parent 27350e3 commit 92863f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"build:debug": "npx parcel build --target node --no-minify --log-level 5 src/index.ts",
3333
"run:moodle": "cd docker/moodle && docker-compose up",
3434
"run:ilias": "cd docker/ilias && docker-compose up",
35-
"fix:file": "sh -c 'find dist/ -type f -name \"*.js\" -exec sed -i \"s/\\(https\\?|file\\|ftp\\|(chrome\\|moz\\|safari-web\\)-extension\\):\\/\\/[^/]\\+/\\1:\\/\\/?[^/]\\+/g\" {} +'",
35+
"fix:file": "find dist/ -type f -name \"*.js\" -exec sed -i -r 's/\\/\\(https\\?\\|file\\|ftp\\|\\(chrome\\|moz\\|safari-web\\)-extension\\):\\\\\\/\\\\\\/\\[/\\/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\\\\\/\\\\\\/\\\\\\/?[/g' {} +",
3636
"shebang": "sed -i '1i #!/usr/bin/env node\\n' dist/index.js && chmod +x dist/index.js",
3737
"minify": "find dist -name \"*.js\" -print0 | xargs -0 -P 4 -I {} sh -c 'before=$(wc -c < {}); minify {} > {}.min && after=$(wc -c < {}.min); if [ ${after} -lt ${before} ]; then mv {}.min {}; reduction=$((${before}-${after})); percent=$(awk \"BEGIN {printf \\\"%.2f\\\", ${reduction}/${before}*100}\"); echo \"{} reduced from ${before} to ${after} bytes (${percent}% reduction)\"; else rm {}.min; echo \"{} no reduction achieved, file size unchanged\"; fi'"
3838
},

0 commit comments

Comments
 (0)