Skip to content

Commit

Permalink
fix(win) Normalize Windows path before writing models to disk
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
  • Loading branch information
jeromesimeon committed Oct 17, 2019
1 parent 2930a3a commit 5ce537b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
49 changes: 45 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/concerto-core/lib/modelmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const fs = require('fs');
const fsPath = require('path');
const slash = require('slash');

const DefaultModelFileLoader = require('./introspect/loaders/defaultmodelfileloader');
const Factory = require('./factory');
Expand Down Expand Up @@ -394,7 +395,8 @@ class ModelManager {
if (file.isExternal() && !opts.includeExternalModels) {
return;
}
const filename = file.fileName.split(fsPath.sep).pop();
// Always assume file names have been normalized from `\` to `/`
const filename = slash(file.fileName).split('/').pop();
fs.writeFileSync(path + fsPath.sep + filename, file.definitions);
});
}
Expand Down
1 change: 1 addition & 0 deletions packages/concerto-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"jsome": "2.5.0",
"lorem-ipsum": "1.0.6",
"moment-mini": "2.22.1",
"slash": "3.0.0",
"triple-beam": "1.3.0",
"urijs": "1.19.1",
"uuid": "3.3.2",
Expand Down

0 comments on commit 5ce537b

Please sign in to comment.