Skip to content

Commit

Permalink
fix: workspace fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslin committed Sep 3, 2021
1 parent fc23762 commit 4f4bfab
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/engine-server/src/workspace/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
DVault,
DWorkspaceV2,
getSlugger,
getStage,
isBlockAnchor,
NoteProps,
VaultUtils,
Expand All @@ -26,7 +27,13 @@ export class WorkspaceUtils {
workspaceFolders?: readonly WorkspaceFolderCode[];
workspaceFile?: URI;
}): WorkspaceType {
if (!_.isUndefined(workspaceFolders)) {
if (
!_.isUndefined(workspaceFile) &&
path.basename(workspaceFile.fsPath) === "dendron.code-workspace"
) {
return WorkspaceType.CODE;
}
if (!_.isUndefined(workspaceFolders) && getStage() !== "prod") {
const dendronWorkspaceFolders =
workspaceFolders.filter((ent) => {
return fs.pathExistsSync(path.join(ent.uri.fsPath, "dendron.yml"));
Expand All @@ -35,12 +42,6 @@ export class WorkspaceUtils {
return WorkspaceType.NATIVE;
}
}
if (
!_.isUndefined(workspaceFile) &&
path.basename(workspaceFile.fsPath) === "dendron.code-workspace"
) {
return WorkspaceType.CODE;
}
return WorkspaceType.NONE;
}
/**
Expand Down

0 comments on commit 4f4bfab

Please sign in to comment.