mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
f6870fa846
refs: https://github.com/TryGhost/Toolbox/issues/479 Framework includes: * command to run tests * command to record tests * mechanism for starting and stopping Ghost before and after each suite of tests * mechanism for loading fixtures into Ghost before starting tests * sample test for controlling Ghost Admin
29 lines
673 B
JavaScript
29 lines
673 B
JavaScript
/**
|
|
* Internal CLI Placeholder
|
|
*
|
|
* If we want to add alternative commands, flags, or modify environment vars, it should all go here.
|
|
* Important: This file should not contain any requires, unless we decide to add pretty-cli/commander type tools
|
|
*
|
|
**/
|
|
|
|
// Don't allow NODE_ENV to be null
|
|
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
|
|
|
const argv = process.argv;
|
|
const mode = argv[2];
|
|
|
|
const command = require('./core/cli/command');
|
|
|
|
// Switch between boot modes
|
|
switch (mode) {
|
|
case 'repl':
|
|
case 'timetravel':
|
|
case 'generate-data':
|
|
case 'record-test':
|
|
command.run(mode);
|
|
break;
|
|
default:
|
|
// New boot sequence
|
|
require('./core/boot')();
|
|
}
|