@@ -16,6 +16,8 @@ module.exports = async({id, argv, config}) => {
16
16
require ( 'debug' ) . enable ( '*' ) ; // eslint-disable-line node/no-extraneous-require
17
17
debug ( 'cli init start with id=%s, argv=%O' , id , argv ) ;
18
18
19
+ // if config cache exists then just load that and move on?
20
+
19
21
// Get config vars
20
22
const ENV_PREFIX = process . env . HYPERDRIVE_BOOTSTRAP_ENV_PREFIX || 'HYPERDRIVE' ;
21
23
const ENV_SEPARATOR = process . env . HYPERDRIVE_BOOTSTRAP_ENV_SEPARATOR || '_' ;
@@ -38,18 +40,40 @@ module.exports = async({id, argv, config}) => {
38
40
39
41
// Then defaults
40
42
bootstrapConf . defaults ( {
41
- mode : 'cli' ,
42
- leia : Object . prototype . hasOwnProperty . call ( process . env , 'LEIA_PARSER_RUNNING' ) ,
43
- packaged : Object . prototype . hasOwnProperty . call ( process , 'pkg' ) ,
44
- plugins : [ ] ,
45
- pluginDirs : [ ] ,
46
43
product : 'hyperdrive' ,
44
+ mode : 'cli' ,
45
+ bootstrap : {
46
+ module : path . join ( __dirname , '..' , '..' , 'utils' , 'bootstrap.js' ) ,
47
+ env : {
48
+ separator : '_' ,
49
+ prefix : 'HYPERDRIVE' ,
50
+ } ,
51
+ landoPlugins : true ,
52
+ // @TODO : core plugin() below?
53
+ /*
54
+ plugins/core
55
+ plugins/
56
+ */
57
+ plugins : [ ] ,
58
+ // @TODO :
59
+ pluginDirs : [ ] ,
60
+ } ,
47
61
} ) ;
48
62
debug ( 'get config from defaults' ) ;
49
63
64
+ // @TODO : optionally add in lando plugin dirs?
65
+ // @NOTE : this will need to do a light lando bootstrap to get plugin dirs and such
66
+ // plugin manifests should be yaml eg dumpable to file
67
+
50
68
// Reset debugger to indicate product status
51
69
debug = createDebugger ( bootstrapConf . get ( 'product' ) , 'hooks' , 'init' ) ;
52
- debug ( 'bootstrap config set to %O' , bootstrapConf . get ( ) ) ;
70
+ debug ( 'bootstrap config set to %O' , bootstrapConf . get ( 'source' ) ) ;
71
+
72
+ // @TODO : load in oclif somewhere?
73
+ // leia: Object.prototype.hasOwnProperty.call(process.env, 'LEIA_PARSER_RUNNING'),
74
+ // packaged: Object.prototype.hasOwnProperty.call(process, 'pkg'),
75
+
76
+ // merge in some oclif stuff?
53
77
54
78
// 0. need to add plugins and plugin dirs to bootstrap config
55
79
// 1. Check if bootstrap exists, throw error if not
@@ -72,22 +96,6 @@ module.exports = async({id, argv, config}) => {
72
96
// *. what do commandIDs do?
73
97
// *. install defaults eg desktop -> lando-desktop
74
98
/*
75
- hyperdrive:
76
- config:
77
- // list of installers
78
- installers:
79
-
80
- // Just OCLIF command objects, this is just a list of metadata
81
- commands:
82
- - {id: 'install', variant: 'lando-docker-engine', path: }
83
-
84
- plugins:
85
- - pathtofunction -> gets config and returns plugin
86
-
87
- // Final mods to commands, useful to add more options/args etc
88
- mods: (?)
89
- - {id: 'install', path: }
90
-
91
99
// commands = [require('./../more/bye')];
92
100
// config.plugins.push(new DynamicPlugin(config))
93
101
// console.log(config.plugins);
0 commit comments