glorfindel-SE-Userscripts/extractScriptMetadata.sh
2017-12-18 22:52:22 +01:00

7 lines
439 B
Bash

#!/bin/bash
# Generate <script>.meta.js files containing only the script's metadata,
# so the whole script doesn't have to be downloaded to check for updates.
# Example use:
# // @updateURL https://raw.githubusercontent.com/Charcoal-SE/Userscripts/master/fire/fire.meta.js
# // @downloadURL https://raw.githubusercontent.com/Charcoal-SE/Userscripts/master/fire/fire.user.js
awk '/./; /\/UserScript/ { exit }' "$1" > "${1/.user./.meta.}"