Skip to content

Commit 6cb0ae2

Browse files
chriskrycholocks
authored andcommitted
Resolve Windows path installation problems. (#24)
* Try using `path.sep` to fix Windows path issues. * Another Windows path issue. * Finish spike on Windows issues.
1 parent 17f0020 commit 6cb0ae2

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

blueprints/ember-cli-typescript/index.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ module.exports = {
77
return [
88
path.join(this.path, 'files', 'tsconfig.json'),
99
path.join(this.path, 'files', 'app', 'config', 'environment.d.ts')
10-
];
10+
];
1111
},
1212

13-
mapFile: function() {
14-
var result = this._super.mapFile.apply(this, arguments);
15-
if (result.indexOf('/tsconfig.json')>-1) {
13+
mapFile: function() {
14+
const result = this._super.mapFile.apply(this, arguments);
15+
16+
const tsconfigPattern = `${path.sep}tsconfig.json`;
17+
const appPattern = `${path.sep}app${path.sep}`;
18+
19+
if (result.indexOf(tsconfigPattern) > -1) {
1620
return 'tsconfig.json';
17-
} else if (result.indexOf('/app/')>-1) {
18-
var pos = result.indexOf('/app/');
19-
return result.substring(pos+1);
21+
} else if (result.indexOf(appPattern) > -1) {
22+
var pos = result.indexOf(appPattern);
23+
return result.substring(pos + 1);
2024
}
2125
},
2226

lib/typescript-preprocessor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ var tsc = require('broccoli-typescript-compiler').typescript;
22
var fs = require('fs');
33
var debug = require('debug')('ember-cli-typescript');
44
var ts = require('typescript');
5+
const path = require('path');
56
var stew = require('broccoli-stew');
67
var find = stew.find;
78
var MergeTrees = require("broccoli-merge-trees");
@@ -45,7 +46,7 @@ function typePaths(config) {
4546
}
4647

4748
TypeScriptPreprocessor.prototype.toTree = function(inputNode, inputPath, outputPath) {
48-
var config = readConfig("./tsconfig.json");
49+
var config = readConfig(path.join(".", "tsconfig.json"));
4950
// "include" setting is meant for the IDE integration,
5051
// broccoli manages its own input files.
5152
if (config.include) {

0 commit comments

Comments
 (0)