Skip to content

Commit

Permalink
Update after code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfdctaka committed Feb 29, 2024
1 parent d057115 commit a0a503d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
"main": "./out/extension.js",
"l10n": "./l10n",
"contributes": {
"menus": {
"commandPalette": [
{
"command": "salesforcedx-vscode-offline-app.configureLintingTools",
"when": "sfdx_project_opened"
}
]
},
"commands": [
{
"command": "salesforcedx-vscode-offline-app.onboardingWizard",
Expand Down
28 changes: 21 additions & 7 deletions src/utils/workspaceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,33 @@ export class WorkspaceUtils {
}

static packageJsonExists(): boolean {
return fs.existsSync(path.join(this.getWorkspaceDir(), PACKAGE_JSON));
try {
return fs.existsSync(
path.join(this.getWorkspaceDir(), PACKAGE_JSON)
);
} catch {
return false;
}
}

static lwcFolderExists(): boolean {
return fs.existsSync(
path.join(this.getWorkspaceDir(), WorkspaceUtils.LWC_PATH)
);
try {
return fs.existsSync(
path.join(this.getWorkspaceDir(), WorkspaceUtils.LWC_PATH)
);
} catch {
return false;
}
}

static isSfdxProjectOpened(): boolean {
return fs.existsSync(
path.join(this.getWorkspaceDir(), SFDX_PROJECT_FILE)
);
try {
return fs.existsSync(
path.join(this.getWorkspaceDir(), SFDX_PROJECT_FILE)
);
} catch {
return false;
}
}
}

Expand Down

0 comments on commit a0a503d

Please sign in to comment.