hooks - GarthDB/phonegap-day-workshop-beginner GitHub Wiki
PhoneGap Hooks
Task hooks to do almost anything you need.
Table of Contents
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.
Usage
You can read the full usage details in:
phonegap-app-pgday/hooks/README.md
Example
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 listGive me a minute... [phonegap] no plugins installed
That's it!