Skip to content

Commit 1e0ab0a

Browse files
committed
fix: Lint errors
1 parent d2e69f3 commit 1e0ab0a

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

builders/_lando-compose.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
module.exports = {
44
name: '_lando-compose',
55
parent: '_lando',
6-
builder: (parent, config) => class LandoComposeServiceV3 extends parent {
6+
builder: parent => class LandoComposeServiceV3 extends parent {
77
constructor(id, options = {}) {
88
super(id, options);
9-
};
9+
}
1010
},
1111
};

utils/parse-events-config.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,23 @@ module.exports = (cmds, app, data, lando) => _.map(cmds, cmd => {
4040
// Discover the service
4141
const service = getService(cmd, data, app._defaultService);
4242

43+
// compute stdio based on compose major version
44+
const cstdio = _.get(app, '_config.orchestratorMV', 2) ? 'inherit' : ['inherit', 'pipe', 'pipe'];
45+
46+
// attempt to ascertain the SAPI
47+
const sapi = _.get(app, 'v4.services', []).find(s => s.id === service)?.api
48+
?? _.get(app, `sapis.${service}`, undefined)
49+
?? _.get(data, `sapis.${service}`, undefined);
50+
51+
// normalize cmd
52+
cmd = getCommand(cmd);
53+
54+
// if array then just join it together
55+
if (_.isArray(cmd)) cmd = cmd.join(' ');
56+
4357
if ('lando' === service) {
4458
const yargs = require('yargs');
45-
const argv = yargs(_.isArray(command) ? command.join(' ') : command).parse();
59+
const argv = yargs(cmd).parse();
4660
const $0 = _.pullAt(argv._, [0])[0];
4761
const toolingTask = _.find(app.tasks, task => $0 === task.command);
4862
argv._eventArgs = argv._;
@@ -59,20 +73,6 @@ module.exports = (cmds, app, data, lando) => _.map(cmds, cmd => {
5973
};
6074
}
6175

62-
// compute stdio based on compose major version
63-
const cstdio = _.get(app, '_config.orchestratorMV', 2) ? 'inherit' : ['inherit', 'pipe', 'pipe'];
64-
65-
// attempt to ascertain the SAPI
66-
const sapi = _.get(app, 'v4.services', []).find(s => s.id === service)?.api
67-
?? _.get(app, `sapis.${service}`, undefined)
68-
?? _.get(data, `sapis.${service}`, undefined);
69-
70-
// normalize cmd
71-
cmd = getCommand(cmd);
72-
73-
// if array then just join it together
74-
if (_.isArray(cmd)) cmd = cmd.join(' ');
75-
7676
// lando 4 services
7777
// @NOTE: lando 4 service events will change once we have a complete hook system
7878
if (sapi === 4) {

utils/parse-tooling-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const getDynamicKeys = (answer, answers = {}) => _(answers)
2020
* Set SERVICE from answers and strip out that noise from the rest of
2121
* stuff, check answers/argv for --service or -s, validate and then remove
2222
*/
23-
const handleDynamic = (config, argv, options = {}, answers = {}, sapis = {}) => {
23+
const handleDynamic = (config, argv, answers = {}, sapis = {}) => {
2424
if (_.startsWith(config.service, ':')) {
2525
const answer = answers[config.service.split(':')[1]];
2626
// Remove dynamic service option from argv
@@ -78,7 +78,7 @@ module.exports = (cmd, service, name, options = {}, answers = {}, sapis = {}) =>
7878
// Put into an object so we can handle "multi-service" tooling
7979
.map(cmd => parseCommand(cmd, service, sapis))
8080
// Handle dynamic services
81-
.map(config => handleDynamic(config, answers._eventArgs ?? process.argv, options, answers, sapis))
81+
.map(config => handleDynamic(config, answers._eventArgs ?? process.argv, answers, sapis))
8282
// Add in any argv extras if they've been passed in
8383
.map(config => handleOpts(config, name, answers._eventArgs ?? process.argv, handlePassthruOpts(options, answers)))
8484
// Wrap the command in /bin/sh if that makes sense

0 commit comments

Comments
 (0)