Skip to content

Commit

Permalink
Use context.fsPath instead of context.workspace.uri.fsPath (#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
nturinski authored Feb 1, 2024
1 parent 6b94d1e commit 64fc853
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion appservice/src/deploy/wizard/DeployExecuteStepBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function getLinuxFxVersionForTelemetry(config: SiteConfigResource): string {
}

async function setDeploymentTelemetry(context: InnerDeployContext, config: SiteConfigResource, aspPromise: Promise<AppServicePlan | undefined>): Promise<void> {
context.telemetry.properties.sourceHash = await randomUtils.getPseudononymousStringHash(context.workspaceFolder.uri.fsPath);
context.telemetry.properties.sourceHash = await randomUtils.getPseudononymousStringHash(context.fsPath);
context.telemetry.properties.destHash = await randomUtils.getPseudononymousStringHash(context.site.fullName);
context.telemetry.properties.scmType = String(config.scmType);
context.telemetry.properties.isSlot = context.site.isSlot ? 'true' : 'false';
Expand Down
2 changes: 1 addition & 1 deletion appservice/src/deploy/wizard/DeployLocalGitExecuteStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import { DeployExecuteStepBase } from "./DeployExecuteStepBase";

export class DeployLocalGitExecuteStep extends DeployExecuteStepBase {
public async deployCore(context: InnerDeployContext): Promise<void> {
await localGitDeploy(context.site, { fsPath: context.workspaceFolder.uri.fsPath }, context);
await localGitDeploy(context.site, { fsPath: context.fsPath }, context);
}
}
2 changes: 1 addition & 1 deletion appservice/src/deploy/wizard/createDeployWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function createDeployExecuteSteps(context: InnerDeployContext): Pro
executeSteps.push(new DeployWarExecuteStep());
} else if (javaRuntime && /^java/i.test(javaRuntime) && !context.site.isFunctionApp) {
const pathFileMap = new Map<string, string>([
[path.basename(context.workspaceFolder.uri.fsPath), 'app.jar']
[path.basename(context.fsPath), 'app.jar']
]);
executeSteps.push(new DeployZipPushExecuteStep(pathFileMap));
} else if (context.deployMethod === 'flexconsumption') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class DeployFlexExecuteStep extends DeployZipBaseExecuteStep {
};

return await runWithZipStream(context, {
fsPath: context.workspaceFolder.uri.fsPath,
fsPath: context.fsPath,
site: context.site,
pathFileMap: this.pathFileMap,
callback,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import { DeployZipBaseExecuteStep } from "./DeployZipBaseExecuteStep";

export class DeployWarExecuteStep extends DeployZipBaseExecuteStep {
public async deployZip(context: InnerDeployContext): Promise<void> {
if (getFileExtension(context.workspaceFolder.uri.fsPath) !== 'war') {
if (getFileExtension(context.fsPath) !== 'war') {
throw new Error(l10n.t('Path specified is not a war file'));
}

const kuduClient = await context.site.createClient(context);
await kuduClient.warPushDeploy(context, () => fs.createReadStream(context.workspaceFolder.uri.fsPath), {
await kuduClient.warPushDeploy(context, () => fs.createReadStream(context.fsPath), {
isAsync: true,
author: publisherName,
deployer: publisherName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export abstract class DeployZipBaseExecuteStep extends DeployExecuteStepBase {
}

public async deployCore(context: InnerDeployContext): Promise<void> {
const fsPath = context.workspaceFolder.uri.fsPath;
const fsPath = context.fsPath;
if (!(await AzExtFsExtra.pathExists(fsPath))) {
throw new Error(l10n.t('Failed to deploy path that does not exist: {0}', fsPath));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class DeployZipPushExecuteStep extends DeployZipBaseExecuteStep {
};

return await runWithZipStream(context, {
fsPath: context.workspaceFolder.uri.fsPath,
fsPath: context.fsPath,
site: context.site,
pathFileMap: this.pathFileMap,
callback,
Expand Down

0 comments on commit 64fc853

Please sign in to comment.