Skip to content

Commit

Permalink
issue #70 on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zaggino committed Sep 12, 2016
1 parent e8f9c65 commit a66e9b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "brackets-electron",
"productName": "Brackets-Electron",
"description": "An open source code editor for the web.",
"description": "Brackets-Electron",
"author": "Brackets Team <[email protected]>",
"license": "MIT",
"homepage": "http://brackets.io",
Expand Down
18 changes: 18 additions & 0 deletions src/project/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,24 @@ define(function (require, exports, module) {
* first launch.
*/
function getInitialProjectPath() {
var shellArgv = appshell.shell.getProcessArgv();
if (shellArgv.length > 1) {
try {
var path = _.last(shellArgv);
var stats = appshell.fs.statSync(path);
path = FileUtils.convertWindowsPathToUnixPath(path);
if (stats.isFile()) {
exports.one("projectOpen", function () {
FileViewController.openFileAndAddToWorkingSet(path);
});
return FileUtils.getDirectoryPath(path);
} else if (stats.isDirectory()) {
return path.endsWith("/") ? path : path + "/";
}
} catch (err) {
/* nothing */
}
}
return updateWelcomeProjectPath(PreferencesManager.getViewState("projectPath"));
}

Expand Down

0 comments on commit a66e9b9

Please sign in to comment.