Skip to content

Commit e14c1cd

Browse files
committed
test
1 parent 96b885e commit e14c1cd

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

lib/DeploymentProvider/Providers/WebAppDeploymentProvider.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const utility = __importStar(require("azure-actions-utility/utility.js"));
5151
const zipUtility = __importStar(require("azure-actions-utility/ziputility.js"));
5252
const promises_1 = require("fs/promises");
5353
const path_1 = __importDefault(require("path"));
54+
const fs = __importStar(require("fs"));
5455
const packageUtility_1 = require("azure-actions-utility/packageUtility");
5556
const BaseWebAppDeploymentProvider_1 = require("./BaseWebAppDeploymentProvider");
5657
const AnnotationUtility_1 = require("azure-actions-appservice-rest/Utilities/AnnotationUtility");
@@ -81,6 +82,7 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
8182
case packageUtility_1.PackageType.folder:
8283
let tempPackagePath = utility.generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false);
8384
// exluding release.zip while creating zip for deployment.
85+
yield this.printFilesInDirectory(webPackage);
8486
const releaseZipPath = path_1.default.join(webPackage, 'releases.zip');
8587
try {
8688
yield (0, promises_1.unlink)(releaseZipPath);
@@ -114,6 +116,27 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
114116
}
115117
});
116118
}
119+
printFilesInDirectory(directoryPath) {
120+
return __awaiter(this, void 0, void 0, function* () {
121+
core.info("release files under a folder");
122+
fs.readdir(directoryPath, (err, files) => {
123+
if (err) {
124+
core.info(`Error reading directory: ${err.message}`);
125+
return;
126+
}
127+
files.forEach(file => {
128+
const filePath = path_1.default.join(directoryPath, file);
129+
fs.stat(filePath, (err, stats) => {
130+
if (err) {
131+
core.info(`Error reading file info: ${err.message}`);
132+
return;
133+
}
134+
core.info(filePath);
135+
});
136+
});
137+
});
138+
});
139+
}
117140
updateStartupCommand() {
118141
return __awaiter(this, void 0, void 0, function* () {
119142
let currentConfig = yield this.appService.getConfiguration();

src/DeploymentProvider/Providers/WebAppDeploymentProvider.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as utility from 'azure-actions-utility/utility.js';
33
import * as zipUtility from 'azure-actions-utility/ziputility.js';
44
import { unlink } from 'fs/promises';
55
import path from 'path';
6+
import * as fs from 'fs';
67

78
import { Package, PackageType } from "azure-actions-utility/packageUtility";
89

@@ -42,6 +43,8 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
4243
case PackageType.folder:
4344
let tempPackagePath = utility.generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false);
4445
// exluding release.zip while creating zip for deployment.
46+
47+
await this.printFilesInDirectory(webPackage);
4548

4649
const releaseZipPath = path.join(webPackage, 'releases.zip');
4750
try {
@@ -80,6 +83,30 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
8083
}
8184
}
8285

86+
private async printFilesInDirectory(directoryPath: string) {
87+
core.info("release files under a folder");
88+
fs.readdir(directoryPath, (err, files) => {
89+
if (err) {
90+
core.info(`Error reading directory: ${err.message}`);
91+
return;
92+
}
93+
94+
files.forEach(file => {
95+
const filePath = path.join(directoryPath, file);
96+
fs.stat(filePath, (err, stats) => {
97+
if (err) {
98+
core.info(`Error reading file info: ${err.message}`);
99+
return;
100+
}
101+
102+
103+
core.info(filePath);
104+
105+
});
106+
});
107+
});
108+
}
109+
83110
private async updateStartupCommand() {
84111
let currentConfig = await this.appService.getConfiguration();
85112
let currentStartupCommand = currentConfig.properties.appCommandLine;

0 commit comments

Comments
 (0)