Permalink
Browse files

only create a .travis.yml if a package.json file exists so this proje…

…ct is useful for other build targets like ruby
  • Loading branch information...
1 parent 3e18ec6 commit c827df65c75af4664233ebc2d3d0af65ba15f6d6 @substack committed Apr 12, 2012
Showing with 5 additions and 6 deletions.
  1. +4 −5 bin/cmd.js
  2. +1 −1 package.json
View
@@ -35,11 +35,10 @@ withConfig(function (config) {
}
else {
var dir = gitDir(process.cwd());
- if (!path.existsSync(dir + '/.travis.yml')) {
- var pkg = path.existsSync(dir + '/package.json')
- ? JSON.parse(fs.readFileSync(dir + '/package.json'))
- : {}
- ;
+ if (!path.existsSync(dir + '/.travis.yml')
+ && path.existsSync(dir + '/package.json')) {
+ var pkg = JSON.parse(fs.readFileSync(dir + '/package.json'));
+
var sv = (pkg.engines || {}).node || '>=0.4';
var vs = [ '0.4.12', '0.6.15' ].filter(function (v) {
return semver.satisfies(v, sv);
View
@@ -1,7 +1,7 @@
{
"name" : "travisify",
"description" : "add travis-ci hooks to github",
- "version" : "0.1.0",
+ "version" : "0.1.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/travisify.git"

0 comments on commit c827df6

Please sign in to comment.