0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added support for --all and --offline to yarn dev

The --all flag will run all of our apps and services including Stripe
The --offline flag will disable any network services, e.g. Stripe
This commit is contained in:
Fabien "egg" O'Carroll 2023-04-27 00:55:03 +01:00
parent a90cc2d7ab
commit be28283b36

15
.github/dev.js vendored
View file

@ -40,7 +40,7 @@ if (DASH_DASH_ARGS.includes('ghost')) {
commands = [COMMAND_GHOST, COMMAND_ADMIN]; commands = [COMMAND_GHOST, COMMAND_ADMIN];
} }
if (DASH_DASH_ARGS.includes('portal')) { if (DASH_DASH_ARGS.includes('portal') || DASH_DASH_ARGS.includes('all')) {
commands.push({ commands.push({
name: 'portal', name: 'portal',
command: 'yarn dev', command: 'yarn dev',
@ -51,7 +51,7 @@ if (DASH_DASH_ARGS.includes('portal')) {
COMMAND_GHOST.env['portal__url'] = 'http://localhost:5368/umd/portal.min.js'; COMMAND_GHOST.env['portal__url'] = 'http://localhost:5368/umd/portal.min.js';
} }
if (DASH_DASH_ARGS.includes('search')) { if (DASH_DASH_ARGS.includes('search') || DASH_DASH_ARGS.includes('all')) {
commands.push({ commands.push({
name: 'search', name: 'search',
command: 'yarn dev', command: 'yarn dev',
@ -63,8 +63,11 @@ if (DASH_DASH_ARGS.includes('search')) {
COMMAND_GHOST.env['sodoSearch__styles'] = 'http://localhost:5370/umd/main.css'; COMMAND_GHOST.env['sodoSearch__styles'] = 'http://localhost:5370/umd/main.css';
} }
(async () => { async function handleStripe() {
if (DASH_DASH_ARGS.includes('stripe')) { if (DASH_DASH_ARGS.includes('stripe') || DASH_DASH_ARGS.includes('all')) {
if (DASH_DASH_ARGS.includes('offline')) {
return;
}
console.log('Fetching Stripe secret token..'); console.log('Fetching Stripe secret token..');
let stripeSecret; let stripeSecret;
@ -88,6 +91,10 @@ if (DASH_DASH_ARGS.includes('search')) {
env: {} env: {}
}); });
} }
}
(async () => {
await handleStripe();
if (!commands.length) { if (!commands.length) {
console.log(`No commands provided`); console.log(`No commands provided`);