Skip to content

Commit 643e45e

Browse files
committed
#25: Remove windows command entrypoint and move debug handling to top of bin/hyperdrive
1 parent 9fcd91e commit 643e45e

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

bin/hyperdrive

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
#!/usr/bin/env node
2+
3+
// Check for --debug and internally set DEBUG=* if its set
4+
// @TODO: we should make debug a string flag so it can work like setting DEBUG=something
5+
// @TODO: should we handle --debug on our own or use something lightweight like minimist?
6+
// @TODO: or maybe add this as a util?
7+
// @TODO: we should give preference to process.env.DEBUG if its set.
8+
if (process.argv.slice(2).find(element => element === '--debug') === '--debug') {
9+
require('debug').enable('*'); // eslint-disable-line node/no-extraneous-require
10+
}
11+
212
require('@oclif/command')
313
.run()
414
.then(require('@oclif/command/flush'))

bin/hyperdrive.cmd

Lines changed: 0 additions & 3 deletions
This file was deleted.

cli/hooks/init.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ const LandoOclifPlugin = require('./../../utils/plugin');
66

77
module.exports = async({id, argv, config}) => {
88
let debug = createDebugger(config.dirname, 'hooks', 'init');
9-
// Check for --debug and internally set DEBUG=* if its set
10-
// @TODO: we should make debug a string flag so it can work like setting DEBUG=something
11-
// @TODO: should we handle --debug on our own or use something lightweight like minimist?
12-
// @TODO: or maybe add this as a util?
13-
// @TODO: this should go at the top of bin/hyperdrive so we get debug output before this point
14-
// @TODO: we should give preference to process.env.DEBUG if its set.
15-
if ([id, ...argv].find(element => element === '--debug') === '--debug') {
16-
require('debug').enable('*'); // eslint-disable-line node/no-extraneous-require
17-
}
189
// Below is mostly just to DEBUG confirm we can get this far
1910
debug('cli init start with id=%s, argv=%O', id, argv);
2011

12+
// @TODO: eventually we will want to grab a cached config file that was the result of a previous bootstrap
13+
// for speed purposes, we want to minimize the time it takes to show the list of commands or help and put all
14+
// time instensive dep loading after the command has been run().
15+
// @NOTE that the config file should likely be in a hashmap where landoAppRoot -> someconfigfile because a Landofile
16+
// may contain plugins that hyperdrive needs to install for that lando app or it may contain some config overrides
17+
// eg maybe a given lando app wants to set a default plugin install method or provides a new installer/command
18+
// within itself
19+
// @TODO: this also implies we have a way to delete the cache, it would be cool if we could target that deletion
20+
// for specific things so that clearing the cache for app A does not blow away the cache for app B
21+
2122
// @TODOS:
2223
/*
2324
* ~~1. get debug flag~~
24-
* 2. plugin helper commands that to do not require lodash (find plugins)
25+
* ~~2. plugin helper commands that to do not require lodash (find plugins)~~
2526
* 3. extended plugin class with extra methods?
2627
* * eg removeCommand, replaceCommand
2728
* 4. extended plugin class with ability to dynamically add commands vs from manifest file

0 commit comments

Comments
 (0)