-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
run.js
49 lines (40 loc) · 1.33 KB
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
const meow = require('meow');
const colors = require('colors');
const path = require('path');
const run = require('./_setup/runCommand.js');
const setupVersion = require('./_setup/setupVersion.js');
const versionsRecursively = require('./_setup/versionsRecursively.js');
const getVersions = require('./_setup/getVersions.js');
const program = require('./_setup/program.js');
const compileExample = require('./_setup/compileExample');
const cli = meow(`
Run given Laravel version
$ node run.js {LaravelVersion}
Options
--verbose, -v Output composer / npm output
--ignore-example, -ix Do not update and build the example repo
Examples
$ node run.js "7.*"
`, {
flags: {
verbose: {
type: 'boolean',
alias: 'v'
}
}
});
async function main () {
const currentDirectory = process.cwd();
const useGivenVersions = getVersions(cli.input);
if (useGivenVersions === null) {
throw new Error('You need to provide a version')
}
await versionsRecursively(useGivenVersions, async function (version) {
await run('docker-compose', ['up', '--build'], currentDirectory, cli.flags.verbose, {
IMAGE_VERSION: version.image_version,
LARAVEL_VERSION: version.laravel,
} );
});
}
program(process, cli, 'Preparing', main)