Skip to content

Commit

Permalink
fix: update error message when symlink exist (#11307)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinezh authored Apr 8, 2024
1 parent 26ca994 commit 87f45d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/fx-core/resource/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
"depChecker.learnMoreButtonText": "Learn more",
"depChecker.needInstallNpm": "You must have NPM installed to debug your local functions.",
"depChecker.failToValidateFuncCoreTool": "Unable to validate Azure Functions Core Tools after installation.",
"depChecker.symlinkDirAlreadyExist": "The destination of the symlink already exists",
"depChecker.symlinkDirAlreadyExist": "The destination of the symlink (%s) already exists, please remove it and try again.",
"depChecker.portableFuncNodeNotMatched": "Your Node.js (@NodeVersion) is incompatible with Teams Toolkit Azure Functions Core Tools (@FuncVersion).",
"depChecker.invalidFuncVersion": "The format of version %s is invalid.",
"depChecker.noSentinelFile": "Azure Functions Core Tools installation is incomplete.",
Expand Down
3 changes: 2 additions & 1 deletion packages/fx-core/src/common/deps-checker/constant/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const Messages = {
getLocalizedString("depChecker.portableFuncNodeNotMatched")
.replace("@NodeVersion", nodeVersion)
.replace("@FuncVersion", funcVersion),
symlinkDirAlreadyExist: () => getLocalizedString("depChecker.symlinkDirAlreadyExist"),
symlinkDirAlreadyExist: (linkFilePath: string) =>
getLocalizedString("depChecker.symlinkDirAlreadyExist", linkFilePath),
invalidFuncVersion: (version: string) =>
getLocalizedString("depChecker.invalidFuncVersion", version),
noSentinelFile: () => getLocalizedString("depChecker.noSentinelFile"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function createSymlink(target: string, linkFilePath: string): Promi
await unlinkSymlink(linkFilePath);
// check if destination already exists
if (await fs.pathExists(linkFilePath)) {
throw new DepsCheckerError(Messages.symlinkDirAlreadyExist(), v3DefaultHelpLink);
throw new DepsCheckerError(Messages.symlinkDirAlreadyExist(linkFilePath), v3DefaultHelpLink);
}

return await fs.ensureSymlink(
Expand Down

0 comments on commit 87f45d7

Please sign in to comment.