-
Notifications
You must be signed in to change notification settings - Fork 13
hooks
mwbrooks edited this page Oct 23, 2014
·
3 revisions
Task hooks to do almost anything you need.
PhoneGap hooks allow you to run custom scripts before and/or after almost any command. This can become a powerful way to extend PhoneGap in ways that it does not yet support, such as moving around artifacts or linking into a continuous integration system.
You can read the full usage details in:
phonegap-app-pgday/hooks/README.md
Let's create a simple example that outputs a message before listing your plugins.
-
Open the directory
phonegap-app-pgday
-
Create the directory
hooks/before_plugin_ls
-
Create the file
hooks/before_plugin_ls/echo.js
-
Add the following to the file:
#!/usr/bin/env node console.log('Give me a minute...');
-
Make the file executable:
- OS X and Linux: type the command
$ chmod +x hooks/before_plugin_list/echo.js
- Windows: right-click and select Properties then update the permissions for all users.
-
Type
$ phonegap plugin list
Give me a minute... [phonegap] no plugins installed
That's it!