Skip to content

Commit e4c4296

Browse files
committed
Correct fsPath
1 parent 6238290 commit e4c4296

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/commands/deployWorkspaceProject/deployWorkspaceProjectApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { type ResourceGroup } from "@azure/arm-resources";
77
import { ResourceGroupListStep } from "@microsoft/vscode-azext-azureutils";
88
import { createSubscriptionContext, subscriptionExperience, type IActionContext, type ISubscriptionActionContext } from "@microsoft/vscode-azext-utils";
99
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";
10-
import { type WorkspaceFolder } from "vscode";
10+
import { Uri, type WorkspaceFolder } from "vscode";
1111
import { ext } from "../../extensionVariables";
1212
import { getWorkspaceFolderFromPath } from "../../utils/workspaceUtils";
1313
import { type DeployWorkspaceProjectContext } from "./DeployWorkspaceProjectContext";
@@ -40,8 +40,8 @@ export async function deployWorkspaceProjectApi(context: IActionContext, deployW
4040
Object.assign(subscriptionActionContext, {
4141
resourceGroup,
4242
rootFolder,
43-
srcPath,
44-
dockerfilePath,
43+
srcPath: srcPath ? Uri.file(srcPath).fsPath : undefined,
44+
dockerfilePath: dockerfilePath ? Uri.file(dockerfilePath).fsPath : undefined,
4545
skipContainerAppCreation,
4646
shouldSaveDeploySettings: !!shouldSaveDeploySettings,
4747
apiEntryPoint: true,

src/utils/workspaceUtils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { UserCancelledError, type IActionContext, type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils";
77
import { basename } from "path";
8-
import { window, workspace, type OpenDialogOptions, type Uri, type WorkspaceFolder } from "vscode";
8+
import { Uri, window, workspace, type OpenDialogOptions, type WorkspaceFolder } from "vscode";
99
import { browseItem, dockerfileGlobPattern, envFileGlobPattern } from "../constants";
1010
import { type SetTelemetryProps } from "../telemetry/SetTelemetryProps";
1111
import { type WorkspaceFileTelemetryProps as TelemetryProps } from "../telemetry/WorkspaceFileTelemetryProps";
@@ -55,14 +55,14 @@ export async function selectWorkspaceFile(
5555
}
5656

5757
if (options.autoSelectIfOne && files.length === 1) {
58-
return files[0].path;
58+
return files[0].fsPath;
5959
}
6060

6161
quickPicks.push(...files.map((uri: Uri) => {
6262
return {
6363
label: basename(uri.path),
6464
description: uri.path,
65-
data: uri.path
65+
data: uri.fsPath
6666
};
6767
}));
6868

@@ -82,7 +82,7 @@ export async function selectWorkspaceFile(
8282
if (input?.data === skipForNow) {
8383
return undefined;
8484
} else {
85-
return input?.data || (await context.ui.showOpenDialog(options))[0].path;
85+
return input?.data || (await context.ui.showOpenDialog(options))[0].fsPath;
8686
}
8787
}
8888

@@ -101,5 +101,5 @@ export async function getRootWorkspaceFolder(placeHolder?: string): Promise<Work
101101
}
102102

103103
export function getWorkspaceFolderFromPath(path: string): WorkspaceFolder | undefined {
104-
return workspace.workspaceFolders?.find(folder => folder.uri.path === path);
104+
return workspace.workspaceFolders?.find(folder => folder.uri.fsPath === Uri.file(path).fsPath);
105105
}

0 commit comments

Comments
 (0)