Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Command name (options.id) is undefined in a hook #108

Closed
Zeko369 opened this issue Apr 28, 2020 · 2 comments
Closed

Command name (options.id) is undefined in a hook #108

Zeko369 opened this issue Apr 28, 2020 · 2 comments

Comments

@Zeko369
Copy link

Zeko369 commented Apr 28, 2020

We had a problem in this hook which is the same as the example, where options.id was undefined.

console.log(options.id); // returns undefined
console.log((options as any).Command.id); // returns command name

At first I thought that it could be a problem because I ran it on the init hook, but the official example is pretty much this.

Did I use it wrong?, Are the TS annotations wrong?

@RasPhilCo
Copy link
Contributor

Are you running an init hook? It's set as id here.

@Zeko369
Copy link
Author

Zeko369 commented May 17, 2020

I think that at some point we switched to prerun hook by accident when testing something and forgot 😅, got it working now

@Zeko369 Zeko369 closed this as completed May 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants