Skip to content

Commit 99e1d3a

Browse files
author
Maxim Lobanov
committed
test package path
1 parent 2e2e2d2 commit 99e1d3a

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

dist/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,10 @@ class SDKManager {
16921692
}
16931693
return parsedPackages;
16941694
}
1695+
getPackagePath(packageInfo) {
1696+
const relativePath = packageInfo.name.replace(";", "/");
1697+
return path_1.default.join(this.sdkManagerPath, relativePath);
1698+
}
16951699
async run(args, printOutputInDebug) {
16961700
let stdout = "";
16971701
let previousPrintedLine = "";
@@ -1809,6 +1813,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18091813
const core = __importStar(__webpack_require__(470));
18101814
const exec = __importStar(__webpack_require__(986));
18111815
const os = __importStar(__webpack_require__(87));
1816+
const fs = __importStar(__webpack_require__(747));
18121817
const sdk_manager_1 = __webpack_require__(857);
18131818
const utils_1 = __webpack_require__(611);
18141819
const getListInput = (inputName) => {
@@ -1842,6 +1847,10 @@ const run = async () => {
18421847
continue;
18431848
}
18441849
await sdkmanager.install(foundPackage);
1850+
const localPackagePath = sdkmanager.getPackagePath(foundPackage);
1851+
console.log(localPackagePath);
1852+
console.log(fs.existsSync(localPackagePath));
1853+
console.log(fs.readdirSync(localPackagePath).join(", "));
18451854
}
18461855
}
18471856
catch (error) {

src/sdk-manager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ export class SDKManager {
2626
return parsedPackages;
2727
}
2828

29+
public getPackagePath(packageInfo: AndroidPackageInfo): string {
30+
const relativePath = packageInfo.name.replace(";", "/");
31+
return path.join(this.sdkManagerPath, relativePath);
32+
}
33+
2934
private async run(args: string[], printOutputInDebug: boolean): Promise<string> {
3035
let stdout = "";
3136
let previousPrintedLine = "";

src/setup-android-tools.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as core from "@actions/core";
22
import * as exec from "@actions/exec";
33
import * as os from "os";
4+
import * as fs from "fs";
45
import { SDKManager } from "./sdk-manager";
56
import { splitByEOL } from "./utils";
67

@@ -40,6 +41,11 @@ const run = async(): Promise<void> => {
4041
}
4142

4243
await sdkmanager.install(foundPackage);
44+
45+
const localPackagePath = sdkmanager.getPackagePath(foundPackage);
46+
console.log(localPackagePath);
47+
console.log(fs.existsSync(localPackagePath));
48+
console.log(fs.readdirSync(localPackagePath).join(", "));
4349
}
4450
} catch (error) {
4551
core.setFailed(error.message);

0 commit comments

Comments
 (0)