From 8cb4049be4382c2ca794ed9632bbc96d55974d2f Mon Sep 17 00:00:00 2001 From: intelliot and quinnjn Date: Wed, 18 Jan 2017 19:58:15 +0000 Subject: [PATCH 1/3] Add Demo page * Demo page in README * Script to help publish `master` to gh-pages * `npm run publish:demo` to call publish script --- README.md | 6 ++++++ package.json | 3 ++- publish-gh-pages.sh | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 publish-gh-pages.sh diff --git a/README.md b/README.md index b441a55..9a032ad 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,12 @@ Restricted Input Allow restricted character sets in `input` elements. +## Demo + +Try the latest version of Restricted Input: + +http://braintree.github.io/restricted-input/ + ## Features - Disallow arbitrary chars based on patterns diff --git a/package.json b/package.json index 889c806..1ad4135 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "test:watch": "karma start config/karma.js", "test:unit": "karma start config/karma.js --single-run", "test:integration": ". ./.env && bundle exec rake sauce:spec test_files=spec", - "test:all": "npm run test && npm run test:integration" + "test:all": "npm run test && npm run test:integration", + "publish:demo": "./publish-gh-pages.sh" }, "devDependencies": { "browserify": "13.0.1", diff --git a/publish-gh-pages.sh b/publish-gh-pages.sh new file mode 100755 index 0000000..f2eec63 --- /dev/null +++ b/publish-gh-pages.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +git checkout master + +npm run build + +cp test/support/index.html dist/ + +git checkout gh-pages + +mv dist/* . + +git add restricted-input.js +git add index.html +git commit -ve -m 'Update test page for restricted-input' + +echo 'You can now `git push` to gh-pages!' From 86cc74c45f4af1e9d382cef44ce149b84407baf3 Mon Sep 17 00:00:00 2001 From: quinnjn Date: Wed, 18 Jan 2017 22:41:44 +0000 Subject: [PATCH 2/3] Exit publish script early on errors, https and inline link --- README.md | 4 +--- publish-gh-pages.sh | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a032ad..d5bf3a2 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,7 @@ Allow restricted character sets in `input` elements. ## Demo -Try the latest version of Restricted Input: - -http://braintree.github.io/restricted-input/ +Try the latest version of Restricted Input [here](https://braintree.github.io/restricted-input/). ## Features diff --git a/publish-gh-pages.sh b/publish-gh-pages.sh index f2eec63..ee81d48 100755 --- a/publish-gh-pages.sh +++ b/publish-gh-pages.sh @@ -1,4 +1,7 @@ #!/bin/bash +set -e # aborts if there are errors +set -u # errors if you use an undefined variable +set -o pipefail # errors if a pipe fails git checkout master From a1d296b39c5e3a32f33ccc1e90e4c09780995047 Mon Sep 17 00:00:00 2001 From: quinnjn Date: Wed, 18 Jan 2017 23:23:22 +0000 Subject: [PATCH 3/3] s/test/demo for gh-pages template commit message --- publish-gh-pages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish-gh-pages.sh b/publish-gh-pages.sh index ee81d48..0065353 100755 --- a/publish-gh-pages.sh +++ b/publish-gh-pages.sh @@ -15,6 +15,6 @@ mv dist/* . git add restricted-input.js git add index.html -git commit -ve -m 'Update test page for restricted-input' +git commit -ve -m 'Update demo page for restricted-input' echo 'You can now `git push` to gh-pages!'