Skip to content

Commit

Permalink
Ask user to save workspace before creating features #94
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFeldhoff committed Feb 9, 2021
1 parent 161f6e9 commit 7fd7400
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vscode-extension/src/App logic/Utils/workspaceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ export class WorkspaceUtils {
let fullFsPath: string;
if (!workspace.workspaceFolders)
throw new Error('No workspacefolder opened.');
if (workspace.workspaceFile) {
fullFsPath = join(dirname(workspace.workspaceFile.fsPath), relativeFsPath);
if (workspace.workspaceFile && workspace.workspaceFile.scheme != 'untitled') {
let workspaceFilePath: string = dirname(workspace.workspaceFile.fsPath)
fullFsPath = join(workspaceFilePath, relativeFsPath);
} else if (workspace.workspaceFolders.length == 1) {
let workspaceFolder: WorkspaceFolder = workspace.workspaceFolders[0];
fullFsPath = join(workspaceFolder.uri.fsPath, relativeFsPath);
} else if (workspace.workspaceFile && workspace.workspaceFile.scheme == 'untitled') {
throw new Error('Please save the workspace before creating features.')
} else {
throw new Error('Expected to find the workspacefolder.')
}
Expand Down

0 comments on commit 7fd7400

Please sign in to comment.