How to use the ern-core.shell.popd function in ern-core

To help you get started, we’ve selected a few ern-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electrode-io / electrode-native / ern-container-gen / src / generateContainer.ts View on Github external
)

  // React-native plugin should be first in the dependencies
  // Otherwise any module dependent on r-n won't be able to use it
  config.plugins = [
    ...(reactNativePlugin ? [reactNativePlugin] : []),
    ...config.plugins.filter(plugin => plugin !== reactNativePlugin),
  ]

  shell.pushd(config.outDir)
  try {
    if (fillContainerHull) {
      await fillContainerHull(config)
    }
  } finally {
    shell.popd()
  }

  const bundlingResult: BundlingResult = await kax
    .task('Bundling MiniApps')
    .run(
      bundleMiniAppsFromComposite({
        compositeDir: config.composite.path,
        outDir: config.outDir,
        platform: config.targetPlatform,
        sourceMapOutput: config.sourceMapOutput,
      })
    )

  if (postBundle) {
    await postBundle(config, bundlingResult)
  }
github electrode-io / electrode-native / ern-local-cli / src / commands / list / dependencies.ts View on Github external
await logErrorAndExitIfNotSatisfied({
      manifestIdExists: {
        id: manifestId,
      },
    })
  }

  let pathToModule = process.cwd()
  if (module) {
    pathToModule = createTmpDir()
    shell.pushd(pathToModule)
    try {
      await yarn.init()
      await yarn.add(PackagePath.fromString(module))
    } finally {
      shell.popd()
    }
  }
  const dependencies = await findNativeDependencies(
    path.join(pathToModule, 'node_modules'),
    { manifestId }
  )

  if (json) {
    process.stdout.write(JSON.stringify(dependencies))
  } else {
    console.log(chalk.bold.yellow('Native dependencies :'))
    logDependencies(dependencies.apis, 'APIs')
    logDependencies(dependencies.nativeApisImpl, 'Native API Implementations')
    logDependencies(
      dependencies.thirdPartyInManifest,
      'Third party declared in Manifest'
github electrode-io / electrode-native / ern-container-gen / src / publishers / GithubPublisher.ts View on Github external
const git = gitCli()
      log.debug(`Cloning git repository(${config.url}) to ${workingGitDir}`)
      await gitCli().cloneAsync(config.url, '.')
      shell.rm('-rf', `${workingGitDir}/*`)
      shell.cp('-Rf', path.join(config.containerPath, '{.*,*}'), workingGitDir)
      await git.addAsync('./*')
      await git.commitAsync(`Container v${config.containerVersion}`)
      await git.tagAsync([`v${config.containerVersion}`])
      await git.pushAsync('origin', 'master')
      await git.pushTagsAsync('origin')
      log.info('[=== Completed publication of the Container ===]')
      log.info(`[Publication url : ${config.url}]`)
      log.info('[Git Branch: master]')
      log.info(`[Git Tag: v${config.containerVersion}]`)
    } finally {
      shell.popd()
    }
  }
}
github electrode-io / electrode-native / ern-container-gen / src / publishers / JcenterPublisher.ts View on Github external
mustacheConfig,
      path.join(config.containerPath, 'lib', 'jcenter-publish.gradle')
    )

    try {
      log.info('[=== Starting build and jcenter publication ===]')
      shell.pushd(config.containerPath)
      await this.buildAndUploadArchive()
      log.info('[=== Completed build and publication of the Container ===]')
      log.info(
        `[Artifact: ${config.extra.groupId}:${config.extra.artifactId}:${
          config.containerVersion
        } ]`
      )
    } finally {
      shell.popd()
    }
  }
github electrode-io / electrode-native / ern-orchestrator / src / launchOnSimulator.ts View on Github external
await kax
      .task('Building iOS Runner project')
      .run(buildIosRunner(pathToIosRunner, iPhoneSim.udid))
    await kax
      .task('Installing iOS Runner on Simulator')
      .run(
        ios.installApplicationOnSimulator(
          iPhoneSim.udid,
          `${pathToIosRunner}/build/Debug-iphonesimulator/ErnRunner.app`
        )
      )
    await kax
      .task('Launching Runner')
      .run(ios.launchApplication(iPhoneSim.udid, 'com.yourcompany.ernrunner'))
  } finally {
    shell.popd()
  }
}
github electrode-io / electrode-native / ern-container-gen / src / publishers / MavenPublisher.ts View on Github external
`
    )

    try {
      log.info('[=== Starting build and publication ===]')
      shell.pushd(config.containerPath)
      await this.buildAndUploadArchive()
      log.info('[=== Completed build and publication of the Container ===]')
      log.info(`[Publication url : ${config.url}]`)
      log.info(
        `[Artifact: ${config.extra.groupId}:${config.extra.artifactId}:${
          config.containerVersion
        } ]`
      )
    } finally {
      shell.popd()
    }
  }
github electrode-io / electrode-native / ern-api-impl-gen / src / generators / android / ApiImplAndroidGenerator.ts View on Github external
paths,
            srcOutputDirectory,
            pluginPath,
            pluginConfig
          )
        }
      }
      const editableFiles = await this.generateRequestHandlerClasses(
        apiDependency,
        paths,
        apis
      )
      await this.updateGradleProperties(paths, outputDirectory)
      await this.updateBuildGradle(paths, reactNativeVersion, outputDirectory)
    } finally {
      shell.popd()
    }
  }
github electrode-io / electrode-native / ern-container-gen-android / src / AndroidGenerator.ts View on Github external
const unzipper = new DecompressZip(jscAARPath)
        const unzipOutDir = createTmpDir()
        const containerJniLibsPath = path.join(
          config.outDir,
          'lib/src/main/jniLibs'
        )
        const unzippedJniPath = path.join(unzipOutDir, 'jni')
        unzipper.on('error', err => reject(err))
        unzipper.on('extract', () => {
          shell.cp('-Rf', unzippedJniPath, containerJniLibsPath)
          resolve()
        })
        unzipper.extract({ path: unzipOutDir })
      })
    } finally {
      shell.popd()
    }
  }
github electrode-io / electrode-native / ern-api-impl-gen / src / generators / js / ApiImplJsGenerator.ts View on Github external
}

      const indexMustacheFile = path.join(
        Platform.currentPlatformVersionPath,
        'ern-api-impl-gen/resources/js/index.mustache'
      )
      const apisMustacheView = {
        apis,
      }
      await mustacheUtils.mustacheRenderToOutputFileUsingTemplateFile(
        indexMustacheFile,
        apisMustacheView,
        path.join(paths.outDirectory, 'index.js')
      )
    } finally {
      shell.popd()
    }
  }
}