How to use the @architect/utils.readArc function in @architect/utils

To help you get started, we’ve selected a few @architect/utils 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 architect / architect / src / before / 01-ensure-creds.js View on Github external
module.exports = function ensureCreds() {

  try {
    readArc()
  }
  catch(e) {
    if (e.message === 'not_found') {
  console.log(chalk.grey('.------------------------------.'))
  console.log(chalk.grey('|'), chalk.bold.yellow('Warning'), chalk.yellow('.arc file not found!'), chalk.grey('|'))
  console.log(chalk.grey('|'), chalk.grey('Generate by running'), chalk.bold.green('arc init'), chalk.grey('|'))
  console.log(chalk.grey('\'------------------------------\''))
    }
  }

  // always ensure NODE_ENV
  if (!process.env.NODE_ENV)
    process.env.NODE_ENV = 'testing'

  // always ensure AWS_REGION
  if (!process.env.AWS_REGION)
github architect / architect / src / before / 02-maybe-banner.js View on Github external
module.exports = function maybeBanner() {
  let version = `Architect ${ver}`
  try {
    utils.readArc()
    utils.banner({version})
    if (process.env.INITIALIZED) {
      let update = utils.updater('Create')
      update.done('Created Architect project manifest (.arc)')
    }
  }
  catch(e) {
    console.log(e)
  }
}

@architect/utils

Common utility functions

Apache-2.0
Latest version published 7 months ago

Package Health Score

67 / 100
Full package analysis