1 | 'use strict';
|
2 |
|
3 | let Forego = require('../lib/forego');
|
4 | let cli = require('heroku-cli-util');
|
5 |
|
6 | function* run (context) {
|
7 | if (context.args.length < 1) {
|
8 | cli.error('Usage: heroku local:run [COMMAND]\nMust specify command to run');
|
9 | process.exit(-1);
|
10 | }
|
11 | let forego = new Forego(context.herokuDir);
|
12 | yield forego.ensureSetup();
|
13 | forego.run(context.args, {flags: context.flags});
|
14 | }
|
15 |
|
16 | module.exports = {
|
17 | topic: 'local',
|
18 | command: 'run',
|
19 | description: 'run a one-off command',
|
20 | help: `Example:
|
21 |
|
22 | heroku local:run bin/migrate`,
|
23 | variableArgs: true,
|
24 | flags: [
|
25 | {name: 'env', char: 'e', hasValue: true},
|
26 | {name: 'port', char: 'p', hasValue: true}
|
27 | ],
|
28 | run: cli.command(run)
|
29 | };
|