From 495438536102aeffe376ddf8adea773092e6036c Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Fri, 29 Sep 2017 16:35:34 +0200 Subject: [PATCH] - fix issue #16: removed build script and prebuild hook - implement release script --- package.json | 4 +--- release.sh | 8 ++++++++ scripts/update-tough-cookie.sh | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 release.sh create mode 100755 scripts/update-tough-cookie.sh 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