Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extend() {
consola.fatal('Build fn')
}
}
.catch((error) => {
require('consola').fatal(error)
process.exit(2)
})
let cmdError
try {
await this.cmd.run(this)
} catch (e) {
cmdError = e
}
if (this.argv.lock) {
await this.releaseLock()
}
if (this.argv['force-exit']) {
const forceExitByUser = this.isUserSuppliedArg('force-exit')
if (cmdError) {
consola.fatal(cmdError)
}
forceExit(this.cmd.name, forceExitByUser ? false : forceExitTimeout)
if (forceExitByUser) {
return
}
}
if (cmdError) {
throw cmdError
}
}
static async eject (args) {
const [blueprint, key] = args[0].split('/')
if (!(blueprint in blueprints)) {
consola.fatal('Unrecognized template bundle -- see docs at https://nuxt.press/')
return
}
if (key === 'theme') {
await ejectTheme(blueprint)
return
}
if (key) {
if (!blueprints[blueprint].templates[key]) {
consola.fatal('Unrecognized template key -- see docs at https://nuxt.press/')
return
}
let template = blueprints[blueprint].templates[key]
if (Array.isArray(template)) {
function exit(err) {
consola.fatal(err.message || err)
process.exit()
}
#!/usr/bin/env node
const consola = require('consola')
try {
require('esm')(module)('../dist/fabula')
.cli().catch((err) => {
consola.fatal(err)
process.exit(1)
})
} catch (err) {
consola.fatal(err)
process.exit(1)
}
static async eject (args) {
const [blueprint, key] = args[0].split('/')
if (!(blueprint in blueprints)) {
consola.fatal('Unrecognized template bundle -- see docs at https://nuxt.press/')
return
}
if (key === 'theme') {
await ejectTheme(blueprint)
return
}
if (key) {
if (!blueprints[blueprint].templates[key]) {
consola.fatal('Unrecognized template key -- see docs at https://nuxt.press/')
return
}
let template = blueprints[blueprint].templates[key]
if (Array.isArray(template)) {
template = template[0]
}
await ejectTemplate(blueprint, template)
return
}
for (let template of Object.values(blueprints[blueprint].templates)) {
if (Array.isArray(template)) {
template = template[0]
}
await ejectTemplate(blueprint, template)
.catch((error) => {
require('consola').fatal(error)
require('exit')(2)
})
const dir1 = get(options, key1, false)
const dir2 = get(options, key2, false)
if (
dir1 &&
dir2 &&
(
dir1 === dir2 ||
(
dir1.startsWith(dir2) &&
!path.basename(dir1).startsWith(path.basename(dir2))
)
)
) {
const errorMessage = `options.${key2} cannot be a parent of or same as ${key1}`
consola.fatal(errorMessage)
throw new Error(errorMessage)
}
}
nodemon.on('crash', () => {
consola.fatal('Server has crashed!')
consola.info('Fix code or use `rs` command to restart server immediately.')
})