Incremental clean up of paths without trailing "/":

- Rename FileUtils.canonicalizeFolderPath() to stripTrailingSlash() since
it actually makes paths NOT canonical. Old API left in place with
deprecation warning for now.
- Add warning to docs for a few other APIs that return non-canonical paths:
FileUtils.getNativeBracketsDirectoryPath(), FileUtils.getNativeModuleDirectoryPath(),
ProjectManager.getInitialProjectPath(), ProjectManager.updateWelcomeProjectPath()
ProjectManager._getWelcomeProjectPath()
- Indicate explicitly which ProjectManager APIs support receiving
non-canonical paths
- Centralize code that touches welcomeProjects storage pref for clarity

What this does NOT do:
- Fix the other APIs listed above that still return non-canonical paths
- Fix non-canonical first-launch project path given to _loadProject()
- Fix non-canonical paths used in RecentProjects prefs
- Fix non-canonical paths used in welcomeProjects pref
- Fix ScopeManager, which in some places requires canonical paths and
in other places requires non-canonical paths
This commit is contained in:
Peter Flynn committed 2013-10-14 20:40:41 -07:00
1 parent a0ca048049
commit a9ab07c38e
5 files changed
+78 -32

No files matched your search

@@ -238,7 +238,7 @@ define(function (require, exports, module) {
}
var testPath = ProjectManager.makeProjectRelativeIfPossible(path);
testPath = FileUtils.canonicalizeFolderPath(testPath);
testPath = FileUtils.stripTrailingSlash(testPath);
return excludes.test(testPath);
}
@@ -1021,7 +1021,7 @@ define(function (require, exports, module) {
}
}
dir = FileUtils.canonicalizeFolderPath(dir);
dir = FileUtils.stripTrailingSlash(dir);
forEachFileInDirectory(dir, doneCallback, fileCallback, directoryCallback);
}