mirror of https://github.com/onivim/oni.git
Change navigateToProjectRoot to accept folders. (#1866)
* Check if the supplied path is a directory, and load that instead if it is. * Tidy up.
This commit is contained in:
parent
b95d22725e
commit
3e397df022
|
@ -130,7 +130,12 @@ export class Workspace implements IWorkspace {
|
|||
|
||||
public navigateToProjectRoot = async (bufferPath: string) => {
|
||||
const projectMarkers = this._configuration.getValue("workspace.autoDetectRootFiles")
|
||||
const cwd = path.dirname(bufferPath)
|
||||
|
||||
// If the supplied path is a folder, we should use that instead of
|
||||
// moving up a folder again.
|
||||
// Helps when calling Oni from the CLI with "oni ."
|
||||
const cwd = (await this.pathIsDir(bufferPath)) ? bufferPath : path.dirname(bufferPath)
|
||||
|
||||
const filePath = await findup(projectMarkers, { cwd })
|
||||
if (filePath) {
|
||||
const dir = path.dirname(filePath)
|
||||
|
|
Loading…
Reference in New Issue