Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function showVersion () {
// get electrode-native local-cli version
if (ernConfig.getValue('platformVersion')) {
log.info(`ern-local-cli : ${ernConfig.getValue('platformVersion')}`)
}
// get electrode-native global-cli version
const packageInfo = JSON.parse(execSync(`npm ls -g electrode-native --json`).toString())
if (packageInfo && packageInfo.dependencies) {
log.info(`electrode-native : ${packageInfo.dependencies['electrode-native'].version}`)
}
}
function showInfo () {
const currentCauldronRepo = ernConfig.getValue('cauldronRepoInUse') || '-NONE-'
console.log(chalk.cyan(`[v${Platform.currentVersion}]`) + chalk.cyan(` [Cauldron: ${currentCauldronRepo}]`))
console.log('')
}
export function getCodePushInitConfig (): CodePushInitConfig {
const codePushConfigFilePath = path.join(process.env.LOCALAPPDATA || process.env.HOME || '', '.code-push.config')
var codePushInitConfig: CodePushInitConfig
if (fs.existsSync(codePushConfigFilePath)) {
codePushInitConfig = JSON.parse(fs.readFileSync(codePushConfigFilePath, 'utf-8'))
} else {
codePushInitConfig = {
'accessKey': config.getValue('codePushAccessKey'),
'customHeaders': config.getValue('codePushCustomHeaders'),
'customServerUrl': config.getValue('codePushCustomServerUrl'),
'proxy': config.getValue('codePushproxy')
}
}
return codePushInitConfig
}
async function runAfterJsCompositeGenerationScript(outDir: string) {
const customScript = config.getValue('custom-script')
if (customScript) {
if (!fs.existsSync(customScript)) {
throw new Error(`custom-script was not found in ${customScript}`)
}
await require(customScript).afterJsCompositeGeneration({ outDir, yarn })
}
}
export function getCodePushInitConfig (): CodePushInitConfig {
const codePushConfigFilePath = path.join(process.env.LOCALAPPDATA || process.env.HOME || '', '.code-push.config')
var codePushInitConfig: CodePushInitConfig
if (fs.existsSync(codePushConfigFilePath)) {
codePushInitConfig = JSON.parse(fs.readFileSync(codePushConfigFilePath, 'utf-8'))
} else {
codePushInitConfig = {
'accessKey': config.getValue('codePushAccessKey'),
'customHeaders': config.getValue('codePushCustomHeaders'),
'customServerUrl': config.getValue('codePushCustomServerUrl'),
'proxy': config.getValue('codePushproxy')
}
}
return codePushInitConfig
}
export function getCodePushInitConfig (): CodePushInitConfig {
const codePushConfigFilePath = path.join(process.env.LOCALAPPDATA || process.env.HOME || '', '.code-push.config')
var codePushInitConfig: CodePushInitConfig
if (fs.existsSync(codePushConfigFilePath)) {
codePushInitConfig = JSON.parse(fs.readFileSync(codePushConfigFilePath, 'utf-8'))
} else {
codePushInitConfig = {
'accessKey': config.getValue('codePushAccessKey'),
'customHeaders': config.getValue('codePushCustomHeaders'),
'customServerUrl': config.getValue('codePushCustomServerUrl'),
'proxy': config.getValue('codePushproxy')
}
}
return codePushInitConfig
}
export function getCodePushInitConfig (): CodePushInitConfig {
const codePushConfigFilePath = path.join(process.env.LOCALAPPDATA || process.env.HOME || '', '.code-push.config')
var codePushInitConfig: CodePushInitConfig
if (fs.existsSync(codePushConfigFilePath)) {
codePushInitConfig = JSON.parse(fs.readFileSync(codePushConfigFilePath, 'utf-8'))
} else {
codePushInitConfig = {
'accessKey': config.getValue('codePushAccessKey'),
'customHeaders': config.getValue('codePushCustomHeaders'),
'customServerUrl': config.getValue('codePushCustomServerUrl'),
'proxy': config.getValue('codePushproxy')
}
}
return codePushInitConfig
}