@@ -36236,9 +36236,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
36236
36236
return result;
36237
36237
};
36238
36238
Object.defineProperty(exports, "__esModule", { value: true });
36239
- exports.isEmptyDirectory = exports. getBooleanInput = exports.getListInput = exports.splitByEOL = void 0;
36239
+ exports.getBooleanInput = exports.getListInput = exports.splitByEOL = void 0;
36240
36240
const core = __importStar(__webpack_require__(470));
36241
- const fs = __importStar(__webpack_require__(747));
36242
36241
exports.splitByEOL = (stdout) => {
36243
36242
return stdout.split(/[\r\n]/);
36244
36243
};
@@ -36249,10 +36248,6 @@ exports.getListInput = (inputName) => {
36249
36248
exports.getBooleanInput = (inputName) => {
36250
36249
return (core.getInput(inputName) || "false").toUpperCase() === "TRUE";
36251
36250
};
36252
- exports.isEmptyDirectory = (directoryPath) => {
36253
- const children = fs.readdirSync(directoryPath);
36254
- return children.length === 0;
36255
- };
36256
36251
36257
36252
36258
36253
/***/ }),
@@ -42050,6 +42045,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
42050
42045
exports.SDKManager = void 0;
42051
42046
const core = __importStar(__webpack_require__(470));
42052
42047
const exec = __importStar(__webpack_require__(986));
42048
+ const fs = __importStar(__webpack_require__(747));
42053
42049
const path_1 = __importDefault(__webpack_require__(622));
42054
42050
const sdk_manager_parser_1 = __webpack_require__(551);
42055
42051
const utils_1 = __webpack_require__(611);
@@ -42074,6 +42070,13 @@ class SDKManager {
42074
42070
const relativePath = packageInfo.name.replace(";", "/");
42075
42071
return path_1.default.join(this.androidHome, relativePath);
42076
42072
}
42073
+ isPackageInstalled(packageInfo) {
42074
+ const packagePath = this.getPackagePath(packageInfo);
42075
+ if (!fs.existsSync(packagePath)) {
42076
+ return false;
42077
+ }
42078
+ return fs.readdirSync(packagePath).length > 0;
42079
+ }
42077
42080
async run(args, printOutputInDebug) {
42078
42081
let stdout = "";
42079
42082
let previousPrintedLine = "";
@@ -47580,7 +47583,7 @@ const run = async () => {
47580
47583
core.info("Trying to restore package from cache...");
47581
47584
const cacheHitKey = await cache.restoreCache([localPackagePath], cacheKey);
47582
47585
cacheHit = Boolean(cacheHitKey);
47583
- if (cacheHit && utils_1.isEmptyDirectory(localPackagePath )) {
47586
+ if (cacheHit && !sdkmanager.isPackageInstalled(foundPackage )) {
47584
47587
core.debug(" [WARNING] Cache is invalid and contains empty folder. ");
47585
47588
cacheHit = false;
47586
47589
}
0 commit comments