Skip to content

Commit

Permalink
Fixing windows integration problems with FS
Browse files Browse the repository at this point in the history
  • Loading branch information
afska committed Sep 2, 2017
1 parent 7b995f0 commit bd8fe52
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/scripts/loaders/remote/desktopGuideLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

const fs = window.GBS_REQUIRE("fs");
const extract = window.GBS_REQUIRE("extract-zip");
const ncp = window.GBS_REQUIRE("ncp");
window.GBS_REQUIRE("setimmediate");

return $.getBinary(
Expand All @@ -46,7 +47,11 @@
});
return deferred.promise();
}).then(() => {
fs.renameSync(`${tmpPath}/proyectos-jr-master`, guidesPath);
const deferred = $.Deferred();
ncp(`${tmpPath}/proyectos-jr-master`, guidesPath, function(err) {
if (err) deferred.reject(err); else deferred.resolve();
});
return deferred.promise();
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/loaders/remote/fsLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
return window.GBS_REQUIRE("recursive-readdir-sync")(path)
.map((it) => {
return {
relativePath: it.replace(this.path + "/", ""),
relativePath: it.replace(/\\/g, "/").replace(this.path.replace(/\\/g, "/"), "").substring(1),
content: toArrayBuffer(window.GBS_REQUIRE("fs").readFileSync(it))
}
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"extract-zip": "^1.6.5",
"finalhandler": "^1.0.2",
"freeport": "^1.0.5",
"ncp": "^2.0.0",
"recursive-readdir-sync": "^1.0.6",
"serve-static": "^1.12.2",
"setimmediate": "^1.0.5",
Expand Down

0 comments on commit bd8fe52

Please sign in to comment.