diff --git a/package.json b/package.json index e877492..1a3dfbc 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,7 @@ "version": "1.5.10", "description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning", "scripts": { - "build": "cp node_modules/umd-tough-cookie/lib/umd-tough-cookie.js www/umd-tough-cookie.js", - "prepublish": "npm run build", - "test": "npm run build && ./scripts/test-installation.sh" + "test": "./scripts/test-installation.sh" }, "cordova": { "id": "cordova-plugin-advanced-http", diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..55baa8b --- /dev/null +++ b/release.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +VERSION=$(node -e "console.log(require('./package.json').version)") + +./scripts/update-tough-cookie.sh +npm publish +git tag "v$VERSION" diff --git a/scripts/update-tough-cookie.sh b/scripts/update-tough-cookie.sh new file mode 100755 index 0000000..1931d59 --- /dev/null +++ b/scripts/update-tough-cookie.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. + +cd $ROOT +npm i +cp node_modules/umd-tough-cookie/lib/umd-tough-cookie.js www/umd-tough-cookie.js