mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-06 08:45:46 +01:00
Normailze path in 'set cwd' rather than in File.joinPaths. Fixes issue #11.
This commit is contained in:
@@ -105,6 +105,7 @@ const IO = Module("io", {
|
|||||||
else {
|
else {
|
||||||
let dir = io.File(newDir);
|
let dir = io.File(newDir);
|
||||||
dactyl.assert(dir.exists() && dir.isDirectory(), "E344: Can't find directory " + dir.path.quote());
|
dactyl.assert(dir.exists() && dir.isDirectory(), "E344: Can't find directory " + dir.path.quote());
|
||||||
|
dir.normalize();
|
||||||
[this._cwd, this._oldcwd] = [dir.path, this.cwd];
|
[this._cwd, this._oldcwd] = [dir.path, this.cwd];
|
||||||
}
|
}
|
||||||
return this.cwd;
|
return this.cwd;
|
||||||
|
|||||||
@@ -547,8 +547,6 @@ const File = Class("File", {
|
|||||||
try {
|
try {
|
||||||
// FIXME: should only expand env vars and normalise path separators
|
// FIXME: should only expand env vars and normalise path separators
|
||||||
path.appendRelativePath(this.expandPath(tail, true));
|
path.appendRelativePath(this.expandPath(tail, true));
|
||||||
if (path.exists())
|
|
||||||
path.normalize();
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return { exists: function () false, __noSuchMethod__: function () { throw e; } };
|
return { exists: function () false, __noSuchMethod__: function () { throw e; } };
|
||||||
|
|||||||
Reference in New Issue
Block a user