Skip to content

Commit

Permalink
Fail gracefully if adding vscode extension fails
Browse files Browse the repository at this point in the history
  • Loading branch information
LorisSigrist committed Mar 12, 2024
1 parent a7609a1 commit e2664c7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions inlang/source-code/paraglide/paraglide-js/src/cli/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,17 @@ export const maybeAddVsCodeExtension = async (args: { projectPath: string }, ctx
project.setSettings(settings)
}

if (!(await Sherlock.isAdopted(ctx.repo.nodeishFs))) {
await Sherlock.add(ctx.repo.nodeishFs)
try {
if (!(await Sherlock.isAdopted(ctx.repo.nodeishFs))) {
await Sherlock.add(ctx.repo.nodeishFs)

ctx.logger.success(
"Added the inlang Visual Studio Code extension (Sherlock) to the workspace recommendations."
ctx.logger.success(
"Added the inlang Visual Studio Code extension (Sherlock) to the workspace recommendations."
)
}
} catch (error) {
ctx.logger.error(
"Failed to add the inlang Visual Studio Code extension (Sherlock). Please open an issue"
)
}
}
Expand Down

0 comments on commit e2664c7

Please sign in to comment.