diff --git a/src/common.js b/src/common.js index 3b32795..2462d4d 100644 --- a/src/common.js +++ b/src/common.js @@ -116,21 +116,7 @@ async function updatePackageJSON(expressInstalled, packageJSON, account, app) { } } -async function checkServerConf() { - log('Checking for server.conf...') - if (!fs.existsSync(path.resolve('server.conf'))) { - log('') - log('your server.conf is not defined. Please run the following to initialize a server.conf:') - log('sectionctl apps init') - prompt.start() - const installOK = ps(`OK to run sectionctl apps init in current directory? ${defaultYes}`) - const res = await prompt.get(installOK) - if (yn(res[installOK], { default: true })) { - const result = spawn.sync('sectionctl', ['apps', 'init'], { - stdio: 'inherit' - }) - } - } +async function npmRunDeploy() { log('') log(chalk.greenBright('🎉 Success!')) log(`You can now run \`${chalk.greenBright('npm run deploy')}\` to deploy your app on section.`) @@ -145,4 +131,4 @@ async function checkServerConf() { } } -module.exports = { checkPackageJSON, checkServerConf, updatePackageJSON } +module.exports = { checkPackageJSON, npmRunDeploy, updatePackageJSON } diff --git a/src/scripts.js b/src/scripts.js index 9934540..83a8cc2 100644 --- a/src/scripts.js +++ b/src/scripts.js @@ -1,4 +1,4 @@ -const { checkPackageJSON, updatePackageJSON, checkServerConf } = require('./common') +const { checkPackageJSON, updatePackageJSON, npmRunDeploy } = require('./common') async function run(cli) { if (!cli.flags.account || !cli.flags.app) { @@ -22,6 +22,6 @@ async function run(cli) { await updatePackageJSON(false, packageJSON, cli.flags.account, cli.flags.app) - await checkServerConf() + await npmRunDeploy() } module.exports.run = run diff --git a/src/static.js b/src/static.js index fd8f42e..4363d72 100644 --- a/src/static.js +++ b/src/static.js @@ -5,7 +5,7 @@ const fs = require('fs') const prompt = require('prompt') const yn = require('yn') const chalk = require('chalk') -const { checkPackageJSON, updatePackageJSON, checkServerConf } = require('./common') +const { checkPackageJSON, updatePackageJSON, npmRunDeploy } = require('./common') const log = console.log const error = chalk.bold.red const warning = chalk.keyword('orange') @@ -109,7 +109,7 @@ async function run(cli) { //TODO: Determine if npm run build exists, and if not, don't include it in predeploy. await updatePackageJSON(expressInstalled, packageJSON, cli.flags.account, cli.flags.app) - await checkServerConf() + await npmRunDeploy() } module.exports.run = run