"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkBuildPresent = exports.getAndroidIndexJsPath = exports.getAppBuildFolder = void 0;
const tslib_1 = require("tslib");
const utils_1 = require("./utils");
const path_1 = tslib_1.__importDefault(require("path"));
const fs_1 = tslib_1.__importDefault(require("fs"));
function getAppBuildFolder(flavorName, release) {
    const buildType = release ? 'release' : 'debug';
    const appPath = `${(0, utils_1.getRootDestinationFolder)()}/android/${flavorName ? `${flavorName}/` : ''}${buildType}`;
    return appPath;
}
exports.getAppBuildFolder = getAppBuildFolder;
function getAndroidIndexJsPath() {
    const androidSpecific = path_1.default.join((0, utils_1.getProjectRootDir)(), 'index.android.js');
    if (fs_1.default.existsSync(androidSpecific)) {
        return androidSpecific;
    }
    else {
        return path_1.default.join((0, utils_1.getProjectRootDir)(), 'index.js');
    }
}
exports.getAndroidIndexJsPath = getAndroidIndexJsPath;
function checkBuildPresent(buildFlavor, release) {
    const appPath = getAppBuildFolder(buildFlavor, release);
    return fs_1.default.existsSync(appPath);
}
exports.checkBuildPresent = checkBuildPresent;
