[travis] shapeup package.json in release

remove devDependencies from package.json.
resolve #495.
This commit is contained in:
otofune 2017-05-28 04:12:15 +09:00
parent df8c28688a
commit dd7bf7c1c1
2 changed files with 14 additions and 0 deletions

View file

@ -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"

13
.travis/shapeup.js Normal file
View file

@ -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)
})
})