Problems with new configDir implementation (can't create instance) #27

Closed
opened 2020-07-21 14:35:02 +00:00 by Ghost · 3 comments

Something's not right with the new configDir changes.

I never used a config file before, but when I don't give a configDir I get this error:

missing `packageRoot` and `configDir`, but no `manager` was supplied

But the implementation is a bit confusing. The confusion begins around https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L121

So the error kind of implies all your problems would go away if you just supply a manager. But when I do that, this line will throw an error (because it's still trying to use the non-existant configDir option to create a path)
https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L128

When I then also give it a configDir, it still fails at this line:
https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L143

Because even though packageRoot is optional, it tries to get the manager property out of it.

It's all a bit confusing, because a few lines down it would default the manager to @greenlock/manager anyway :)
https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L147

Something's not right with the new `configDir` changes. I never used a config file before, but when I don't give a `configDir` I get this error: missing `packageRoot` and `configDir`, but no `manager` was supplied But the implementation is a bit confusing. The confusion begins around https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L121 So the error kind of implies all your problems would go away if you just supply a `manager`. But when I do that, this line will throw an error (because it's still trying to use the non-existant `configDir` option to create a path) https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L128 When I then also give it a `configDir`, it still fails at this line: https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L143 Because even though `packageRoot` is optional, it tries to get the `manager` property out of it. It's all a bit confusing, because a few lines down it would default the manager to `@greenlock/manager` anyway :) https://git.rootprojects.org/root/greenlock.js/src/branch/master/lib/init.js#L147
Owner

Thanks for digging into that. I don't know what your config is, so I don't know exactly what's going on.

However, I'd say:

  1. follow the QuickStart in the README
  2. try making the change that you're trying to make
  3. if there's still a problem, let me know what change you made
Thanks for digging into that. I don't know what your config is, so I don't know exactly what's going on. However, I'd say: 1. follow the QuickStart in the README 2. try making the change that you're trying to make 3. if there's still a problem, let me know what change you made
Owner

I didn't get any feedback from you, so I'm assuming that the Quick Start solved your issue.

If you still need help, let me know.

I didn't get any feedback from you, so I'm assuming that the Quick Start solved your issue. If you still need help, let me know.
Author

Oh sorry, forgot all about it.

I managed to work around the issue by providing these options:

GreenLock.create({
		packageAgent    : package.name + '/' + package.version,
		packageRoot     : PATH_TEMP,
		configDir       : libpath.resolve(PATH_TEMP, 'greenlock.d'),
		manager         : '@greenlock/manager',
})
Oh sorry, forgot all about it. I managed to work around the issue by providing these options: ```javascript GreenLock.create({ packageAgent : package.name + '/' + package.version, packageRoot : PATH_TEMP, configDir : libpath.resolve(PATH_TEMP, 'greenlock.d'), manager : '@greenlock/manager', }) ```
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/greenlock.js#27
No description provided.