UNPKG

829 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const jovo_cli_core_1 = require("jovo-cli-core");
4const project = jovo_cli_core_1.getProject();
5const projectLevelCommands = [
6 'build',
7 'convert',
8 'deploy',
9 'get',
10 'init',
11 'run',
12 'scaffold',
13 'update',
14];
15const versionArgs = ['-v', '-V', '--version', 'version'];
16async function hook() {
17 if (projectLevelCommands.indexOf(process.argv[2]) !== -1 &&
18 versionArgs.indexOf(process.argv[2]) === -1) {
19 if (!(await project.isInProjectDirectory()) && process.argv.indexOf('--help') === -1) {
20 console.error('\nTo use this command, please go into the directory of a valid Jovo project.\n');
21 process.exit(1);
22 }
23 }
24}
25exports.default = hook;
26//# sourceMappingURL=ProjectHook.js.map
\No newline at end of file