Skip to content

Commit

Permalink
Fix HOME for windows and add appveyor (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Jun 5, 2016
1 parent 3885b08 commit bb44638
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
10 changes: 10 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
environment:
nodejs_version: "4.0"
install:
- ps: Install-Product node $env:nodejs_version
- npm install
test_script:
- node --version
- npm --version
- npm test
build: off
2 changes: 1 addition & 1 deletion generators/app/createTemplateCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const rc = require('rc');
const extend = require('extend');

const TEMPLATEVERSION = 0;
const globalConfigPath = path.join(process.env.HOME, '.generator-typingsrc');
const globalConfigPath = path.join(process.env[process.platform === 'win32'? 'USERPROFILE': 'HOME'], '.generator-typingsrc');


module.exports = function createTemplateCommmands(generator) {
Expand Down
1 change: 0 additions & 1 deletion generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const collectingSourceInfo = [];

const TEMPLATEVERSION = 0;
const GENERATORVERSION = '1.0';
const globalConfigPath = path.join(process.env.HOME, '.generator-typingsrc');

module.exports = yeoman.Base.extend({
constructor: function () {
Expand Down
16 changes: 9 additions & 7 deletions test/git.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,24 @@ describe(`${GENERATOR_NAME} git tests`, () => {
it('when it is a cloned git repo', () => {
let generator;
return helpers.run(path.join(__dirname, `../generators/${GENERATOR_NAME}`))
.withOptions({
skipConfiguring: true,
skipDefault: true,
skipWriting: true,
skipInstall: true,
skipGit: true
})
.inTmpDir((dir) => {
let git = simpleGit(dir);
return new Promise((resolve) => {
git.clone('https://github.com/typings/generator-typings-blank-repo-for-test', '.', () => {
console.log('git clone completed');
resolve();
});
});
})
.withOptions({
skipConfiguring: true,
skipDefault: true,
skipWriting: true,
skipInstall: true,
skipGit: true
})
.on('ready', (gen) => {
console.log('helper say ready');
generator = gen;
})
.toPromise()
Expand Down
1 change: 0 additions & 1 deletion test/template.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe(`${GENERATOR_NAME} template tests`, () => {
})
.toPromise()
.then((dir) => {
console.log(generator.configTemplate);
assert.objectContent(generator.configTemplate, template);
});
});
Expand Down

0 comments on commit bb44638

Please sign in to comment.