Skip to content

Commit

Permalink
Merge pull request #394 from AStoker/windows-posix-slashes
Browse files Browse the repository at this point in the history
fix(file-paths): don't use windows style path separators
  • Loading branch information
EisenbergEffect authored Nov 8, 2016
2 parents d3ed4e2 + 54b0862 commit 12d428a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions lib/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ exports.Bundle = class {
contents = concat.content;
let outputDir = platform.baseUrl || platform.output; //If we have a baseUrl, then the files are served from there, else it's the output
if (platform.index) {
this.setIndexFileConfigTarget(platform, path.join(outputDir, bundleFileName));
this.setIndexFileConfigTarget(platform, path.posix.join(outputDir, bundleFileName));
}
}

let mapFileName = bundleFileName + '.map';
let mapSourceRoot = path.relative(
path.join(process.cwd(), platform.output),
path.join(process.cwd(), this.bundler.project.paths.root)
let mapSourceRoot = path.posix.relative(
path.posix.join(process.cwd(), platform.output),
path.posix.join(process.cwd(), this.bundler.project.paths.root)
);

console.log(`Writing ${bundleFileName}...`);
Expand All @@ -184,11 +184,11 @@ exports.Bundle = class {
contents += os.EOL + '//# sourceMappingURL=' + mapFileName;
}

return fs.writeFile(path.join(platform.output, bundleFileName), contents).then(() => {
return fs.writeFile(path.posix.join(platform.output, bundleFileName), contents).then(() => {
this.requiresBuild = false;

if (mapContents) {
return fs.writeFile(path.join(platform.output, mapFileName), mapContents);
return fs.writeFile(path.posix.join(platform.output, mapFileName), mapContents);
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion lib/build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ function modifyFilename(pth, modifier){
}

var ext = path.extname(pth);
return path.join(path.dirname(pth), modifier(path.basename(pth, ext), ext));
return path.posix.join(path.dirname(pth), modifier(path.basename(pth, ext), ext));
}
10 changes: 5 additions & 5 deletions lib/commands/new/project-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ exports.ProjectTemplate = class {

let scriptsLocation = this.scripts.calculateRelativePath(this.projectFolder.parent)

this.model.transpiler.source = path.join(appRoot, '**/*' + this.model.transpiler.fileExtension);
this.model.markupProcessor.source = path.join(appRoot, '**/*' + this.model.markupProcessor.fileExtension);
this.model.cssProcessor.source = path.join(appRoot, '**/*' + this.model.cssProcessor.fileExtension);
this.model.transpiler.source = path.posix.join(appRoot, '**/*' + this.model.transpiler.fileExtension);
this.model.markupProcessor.source = path.posix.join(appRoot, '**/*' + this.model.markupProcessor.fileExtension);
this.model.cssProcessor.source = path.posix.join(appRoot, '**/*' + this.model.cssProcessor.fileExtension);
this.model.platform.output = scriptsLocation;
this.model.platform.index = "index.html";

Expand All @@ -261,7 +261,7 @@ exports.ProjectTemplate = class {
}

if (this.unitTests.parent) {
this.model.unitTestRunner.source = path.join(
this.model.unitTestRunner.source = path.posix.join(
this.unitTests.calculateRelativePath(this.projectFolder.parent),
'**/*' + this.model.transpiler.fileExtension
);
Expand Down Expand Up @@ -347,7 +347,7 @@ exports.ProjectTemplate = class {
install(ui) {
let workingDirectory = this.options.hasFlag('here')
? process.cwd()
: path.join(process.cwd(), this.content.calculateRelativePath());
: path.posix.join(process.cwd(), this.content.calculateRelativePath());

return installDependencies(ui, workingDirectory)
.then(() => runPostInstallProcesses(ui, workingDirectory, this.postInstallProcesses));
Expand Down
4 changes: 2 additions & 2 deletions lib/project-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ exports.ProjectItem = class {
? this.parent.calculateRelativePath(fromLocation)
: '';

return path.join(parentRelativePath, this.name);
return path.posix.join(parentRelativePath, this.name);
}

setJSONObject(jsonObject) {
Expand All @@ -89,7 +89,7 @@ exports.ProjectItem = class {
}

create(ui, relativeTo) {
let fullPath = relativeTo ? path.join(relativeTo, this.name) : this.name;
let fullPath = relativeTo ? path.posix.join(relativeTo, this.name) : this.name;

if (this.isDirectory) {
return fs.exists(fullPath).then(result => {
Expand Down

0 comments on commit 12d428a

Please sign in to comment.