UNPKG

@applicaster/zapplicaster-cli

Version:

CLI Tool for the zapp app and Quick Brick project

54 lines (41 loc) 1.13 kB
const { resolve } = require("path"); const logger = require("../logger"); function isZappReactNativeRepo() { try { const localPackageJson = require(resolve(process.cwd(), "package.json")); return localPackageJson.name === "quick-brick"; } catch (e) { logger.warn("There is no package.json file here !"); return false; } } function getCLIProperties() { const { name, version } = require(resolve(__dirname, "../../package.json")); return { name, version }; } function getApplicasterConfig() { try { const applicasterConfig = require(`${process.env.HOME}/.applicaster.json`); return applicasterConfig; } catch (e) { logger.error( "Cannot find applicaster config - try to run the init command first" ); return {}; } } function getPlatform({ device_target, store }) { if (store === "apple_store") { return device_target === "apple_tv" ? "tvos" : "ios"; } if (store === "google_play" || store === "amazon") { return "android"; } return "web"; } module.exports = { isZappReactNativeRepo, getCLIProperties, getApplicasterConfig, getPlatform, };