From dd7bf7c1c15f063e42f5184c9ee0b108d1f1a3a6 Mon Sep 17 00:00:00 2001 From: otofune Date: Sun, 28 May 2017 04:12:15 +0900 Subject: [PATCH] [travis] shapeup package.json in release remove devDependencies from package.json. resolve #495. --- .travis/release.sh | 1 + .travis/shapeup.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 .travis/shapeup.js diff --git a/.travis/release.sh b/.travis/release.sh index 077e2c58e..5def2ab03 100644 --- a/.travis/release.sh +++ b/.travis/release.sh @@ -7,6 +7,7 @@ chmod 600 ~/.ssh/id_rsa echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config git checkout -b release cp -f ./.travis/.gitignore-release .gitignore +node ./.travis/shapeup.js git add --all git rm --cached `git ls-files --full-name -i --exclude-standard` git config --global user.email "AyaMorisawa4869@gmail.com" diff --git a/.travis/shapeup.js b/.travis/shapeup.js new file mode 100644 index 000000000..8fb69cce9 --- /dev/null +++ b/.travis/shapeup.js @@ -0,0 +1,13 @@ +'use strict' + +const fs = require('fs') +const filename = process.argv[2] || 'package.json' + +fs.readFile(filename, (err, data) => { + if (err) process.exit(2) + const object = JSON.parse(data) + delete object.devDependencies + fs.writeFile(filename, JSON.stringify(object, null, 4) + '\n', err => { + if (err) process.exit(3) + }) +})