How to use the @adonisjs/sink.logger.error function in @adonisjs/sink

To help you get started, we’ve selected a few @adonisjs/sink 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 AdonisCommunity / create-adonis-ts-app / index.ts View on Github external
process.exit(1)
    }
  }

  /**
   * Ensuring that defined path exists
   */
  ensureDirSync(absPath)

  if (!isEmptyDir(absPath)) {
    const errors = [
      `Cannot overwrite contents of {${projectRoot}} directory.`,
      'Make sure to define path to an empty directory',
    ]

    logger.error(errors.join(' '))
    return
  }

  /**
   * Set environment variables that can be used by the packages
   * to tweak their setup behavior
   */
  process.env['ADONIS_CREATE_APP_NAME'] = state.name
  process.env['ADONIS_CREATE_ESLINT'] = String(state.eslint)
  process.env['ADONIS_CREATE_APP_CLIENT'] = state.client
  process.env['ADONIS_CREATE_APP_BOILERPLATE'] = state.boilerplate

  /**
   * Setup application
   */
  const application = new Application(absPath, {} as any, {}, {})
github AdonisCommunity / create-adonis-ts-app / index.ts View on Github external
*/
  process.env['ADONIS_CREATE_APP_NAME'] = state.name
  process.env['ADONIS_CREATE_ESLINT'] = String(state.eslint)
  process.env['ADONIS_CREATE_APP_CLIENT'] = state.client
  process.env['ADONIS_CREATE_APP_BOILERPLATE'] = state.boilerplate

  /**
   * Setup application
   */
  const application = new Application(absPath, {} as any, {}, {})

  for (let task of tasks) {
    try {
      await task(absPath, application, state)
    } catch (err) {
      logger.error('Unable to create new project. Rolling back')
      logger.fatal(err)
      removeSync(absPath)
      return
    }
  }
}