UNPKG

jovo-cli

Version:
26 lines 829 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jovo_cli_core_1 = require("jovo-cli-core"); const project = jovo_cli_core_1.getProject(); const projectLevelCommands = [ 'build', 'convert', 'deploy', 'get', 'init', 'run', 'scaffold', 'update', ]; const versionArgs = ['-v', '-V', '--version', 'version']; async function hook() { if (projectLevelCommands.indexOf(process.argv[2]) !== -1 && versionArgs.indexOf(process.argv[2]) === -1) { if (!(await project.isInProjectDirectory()) && process.argv.indexOf('--help') === -1) { console.error('\nTo use this command, please go into the directory of a valid Jovo project.\n'); process.exit(1); } } } exports.default = hook; //# sourceMappingURL=ProjectHook.js.map