Skip to content

Commit

Permalink
Handle attachment paths properly on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jul 17, 2017
1 parent c0f1c47 commit ae9dd5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medic-configurer-beta",
"version": "1.0.62",
"version": "1.0.63",
"description": "Configure Medic Mobile deployments",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/attachments-from-dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = dir => {
const attachments = {};
fs.recurseFiles(dir)
.forEach(form => {
attachments[fs.path.relative(dir, form)] = attachmentFromFile(form);
const attachmentPath = fs.posixPath(fs.path.relative(dir, form));
attachments[attachmentPath] = attachmentFromFile(form);
});
return attachments;
};
1 change: 1 addition & 0 deletions src/lib/sync-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
mkdir: path => { try { fs.mkdirSync(path); } catch(e) { /* yum yum */ } },
mkdtemp: () => fs.mkdtempSync(`${os.tmpdir()}/medic-conf`),
path: path,
posixPath: p => p.split(path.sep).join('/'),
read: read,
readJson: readJson,
readBinary: path => fs.readFileSync(path),
Expand Down

0 comments on commit ae9dd5a

Please sign in to comment.