Skip to content

Commit 5c543a1

Browse files
authored
Revert "Add: bower support" (#147)
1 parent 219df9b commit 5c543a1

File tree

2 files changed

+3
-42
lines changed

2 files changed

+3
-42
lines changed

index.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var objectAssign = require('object-assign')
1313

1414
module.exports = function standardVersion (argv, done) {
1515
var pkgPath = path.resolve(process.cwd(), './package.json')
16-
var bowerPath = path.resolve(process.cwd(), './bower.json')
1716
var pkg = require(pkgPath)
1817
var defaults = require('./defaults')
1918

@@ -35,15 +34,6 @@ module.exports = function standardVersion (argv, done) {
3534

3635
pkg.version = newVersion
3736
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n', 'utf-8')
38-
try {
39-
var stat = fs.lstatSync(bowerPath)
40-
if (stat.isFile()) {
41-
var bower = require(bowerPath)
42-
bower.version = newVersion
43-
fs.writeFileSync(bowerPath, JSON.stringify(bower, null, 2) + '\n', 'utf-8')
44-
argv.bower = true
45-
}
46-
} catch (e) {}
4737
} else {
4838
checkpoint(args, 'skip version bump on first release', [], chalk.red(figures.cross))
4939
}
@@ -188,19 +178,14 @@ function commit (argv, newVersion, cb) {
188178
var msg = 'committing %s'
189179
var args = [argv.infile]
190180
var verify = argv.verify === false || argv.n ? '--no-verify ' : ''
191-
var bower = ''
192181
if (!argv.firstRelease) {
193182
msg += ' and %s'
194183
args.unshift('package.json')
195184
}
196-
if (argv.bower) {
197-
msg += ' and %s'
198-
args.unshift('bower.json')
199-
bower = ' bower.json'
200-
}
201185
checkpoint(argv, msg, args)
202-
handledExec(argv, 'git add package.json ' + argv.infile + bower, cb, function () {
203-
handledExec(argv, 'git commit ' + verify + (argv.sign ? '-S ' : '') + (argv.commitAll ? '' : ('package.json ' + argv.infile + bower)) + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () {
186+
187+
handledExec(argv, 'git add package.json ' + argv.infile, cb, function () {
188+
handledExec(argv, 'git commit ' + verify + (argv.sign ? '-S ' : '') + (argv.commitAll ? '' : ('package.json ' + argv.infile)) + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () {
204189
cb()
205190
})
206191
})

test.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ function writePackageJson (version, option) {
4949
delete require.cache[require.resolve(path.join(process.cwd(), 'package.json'))]
5050
}
5151

52-
function writeBowerJson (version, option) {
53-
option = option || {}
54-
var bower = objectAssign(option, { version: version })
55-
fs.writeFileSync('bower.json', JSON.stringify(bower), 'utf-8')
56-
}
57-
5852
function writeGitPreCommitHook () {
5953
fs.writeFileSync('.git/hooks/pre-commit', '#!/bin/sh\necho "precommit ran"\nexit 1', 'utf-8')
6054
fs.chmodSync('.git/hooks/pre-commit', '755')
@@ -471,24 +465,6 @@ describe('standard-version', function () {
471465
})
472466
})
473467

474-
describe('with bower.json', function () {
475-
beforeEach(function () {
476-
writeBowerJson('1.0.0')
477-
})
478-
479-
it('check with bower.json', function (done) {
480-
commit('feat: first commit')
481-
shell.exec('git tag -a v1.0.0 -m "my awesome first release"')
482-
commit('feat: new feature!')
483-
require('./index')({silent: true}, function (err) {
484-
should.not.exist(err)
485-
var bower = fs.readFileSync('bower.json', 'utf-8')
486-
bower.should.match(/"version": "1\.2\.0"/)
487-
done()
488-
})
489-
})
490-
})
491-
492468
it('formats the commit and tag messages appropriately', function (done) {
493469
commit('feat: first commit')
494470
shell.exec('git tag -a v1.0.0 -m "my awesome first release"')

0 commit comments

Comments
 (0)