mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
openLocations() flag to require a path to be an existing directory
This commit is contained in:
@@ -1386,7 +1386,7 @@ or use Pane::saveItemAs for programmatic saving.`)
|
||||
if (stats.isDirectory()) {
|
||||
// Directory: add as a project folder
|
||||
foldersToAddToProject.add(this.project.getDirectoryForProjectPath(pathToOpen).getPath())
|
||||
} else if (stats.isFile()) {
|
||||
} else if (stats.isFile() && !location.mustBeDirectory) {
|
||||
// File: add as a file location
|
||||
fileLocationsToOpen.push(location)
|
||||
}
|
||||
@@ -1397,7 +1397,7 @@ or use Pane::saveItemAs for programmatic saving.`)
|
||||
if (directory) {
|
||||
// Found: add as a project folder
|
||||
foldersToAddToProject.add(directory.getPath())
|
||||
} else {
|
||||
} else if (!location.mustBeDirectory) {
|
||||
// Not found: open as a new file
|
||||
fileLocationsToOpen.push(location)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user