Skip to content

Commit 2e5037f

Browse files
authored
Merge pull request #24 from rwjblue/update-travis
Add .travis.yml to newly generated projects.
2 parents b04b29d + 4e1f60d commit 2e5037f

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

commands/global/new.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports.handler = function handler(options) {
1313
let { projectName } = options;
1414

1515
const fs = require('fs-extra');
16+
const { stripIndent } = require('common-tags');
1617
const pkg = require('../../package.json');
1718

1819
fs.outputFileSync(projectName + '/README.md', `# ${projectName}\n`, 'utf8');
@@ -21,7 +22,7 @@ module.exports.handler = function handler(options) {
2122
{
2223
name: projectName,
2324
version: '0.1.0',
24-
script: {
25+
scripts: {
2526
test: 'codemod-cli test',
2627
},
2728
keywords: ['codemod-cli'],
@@ -34,5 +35,30 @@ module.exports.handler = function handler(options) {
3435
spaces: 2,
3536
}
3637
);
38+
fs.outputFileSync(
39+
projectName + '/.travis.yml',
40+
stripIndent`
41+
---
42+
language: node_js
43+
node_js:
44+
- "6"
45+
46+
sudo: false
47+
dist: trusty
48+
49+
cache:
50+
yarn: true
51+
52+
before_install:
53+
- curl -o- -L https://yarnpkg.com/install.sh | bash
54+
- export PATH=$HOME/.yarn/bin:$PATH
55+
56+
install:
57+
- yarn install
58+
59+
script:
60+
- yarn test
61+
`
62+
);
3763
fs.ensureFileSync(projectName + '/transforms/.gitkeep');
3864
};

tests/cli-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ QUnit.module('codemod-cli', function(hooks) {
4141
assert.equal(result.code, 0, 'exited with zero');
4242
assert.deepEqual(walkSync(input.path()), [
4343
'ember-qunit-codemod/',
44+
'ember-qunit-codemod/.travis.yml',
4445
'ember-qunit-codemod/README.md',
4546
'ember-qunit-codemod/package.json',
4647
'ember-qunit-codemod/transforms/',

0 commit comments

Comments
 (0)