New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get hooks to work #71
Comments
You do not want to use a hook to do this. Hooks and commands are different. To create a command, simply create a directory with a javascript file (your command). Then add the directory to the CLI's "paths.commands" config settings. Refer to slide 17 for a nudge in the right direction: http://www.slideshare.net/cb1kenobi/titanium-cli-32-ti-appcamp2-1122013. |
TiNy is already pluggable as a command, but I want to also make it a hook so you can do:
I'm sure there's a hook to transform the arguments? I see similar happening in the |
Hmm... the CLI doesn't have a hook for you to hook into that would allow you modify the command line arguments. The first hook to fire is "cli:command-loaded" and that's done after all the argument parsing passes have completed. The only thing you can do is hook into "cli:command-loaded" and overwrite the parsed cli.argv values.
|
Logging all different, events I think I can better use |
I have the following test hook:
When I run
But when I run
Question: Is there not any hook executed for |
--platform is special and baked into the CLI. If you are running a command that has a |
Aha! I've created a JIRA ticket requesting a hook that executes before the process' argv are parsed by the CLI: |
Brilliant! :) |
I'm writing a hook as apart of TiNy so you can also do:
This should be doable using the hooks, just like the included
tisdk3fixes
hook manipulates the commands given.However, when I add the hook it doesn't log anything when I call
ti build
orti create
etc. When I callti
orti config
it does log.Are the hooks not implemented for
build
andcreate
yet?The text was updated successfully, but these errors were encountered: