Created
May 23, 2017 15:05
-
-
Save Techcable/22fe59fc2b6755c3d94857d581bac8b7 to your computer and use it in GitHub Desktop.
cdnjs Kotlin Javascript Update Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| VERSION="$1" | |
| if [ -z "$VERSION" ]; then | |
| echo "Please enter a version to update to!" >&2; | |
| exit 1; | |
| fi; | |
| echo "Downloading kotlin $VERSION from maven" | |
| OUTPUT_JAR=$(mktemp -t "kotlin-$VERSION-XXX.jar") | |
| STDLIB_URL="https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-js/$VERSION/kotlin-stdlib-js-$VERSION.jar" | |
| wget -O "$OUTPUT_JAR" "$STDLIB_URL" || exit 1 | |
| mkdir -p "$VERSION"; | |
| pushd "$VERSION"; | |
| echo "Extracting kotlin.js $VERSION"; | |
| jar -xf "$OUTPUT_JAR" kotlin.js kotlin.meta.js || { popd && exit 1; } | |
| echo "Minifying kotlin.js $VERSION" | |
| uglifyjs --compress unused=false --mangle --warn -o kotlin.min.js kotlin.js; | |
| popd; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment