Skip to content

Instantly share code, notes, and snippets.

@jayproulx
Last active August 29, 2015 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayproulx/214bfa61684a5c5f0cb9 to your computer and use it in GitHub Desktop.
Save jayproulx/214bfa61684a5c5f0cb9 to your computer and use it in GitHub Desktop.
Create all of the hook directories and add a script to identify the hook running when it executes
#!/bin/bash
# run this as a script in your-phonegap-project/hooks
hooks=(after_build after_compile after_docs after_emulate after_platform_add after_platform_rm after_platform_ls after_plugin_add after_plugin_ls after_plugin_rm after_plugin_search after_plugin_install after_prepare after_run after_serve before_build before_compile before_docs before_emulate before_platform_add before_platform_rm before_platform_ls before_plugin_add before_plugin_ls before_plugin_rm before_plugin_search before_plugin_install before_plugin_uninstall before_prepare before_run before_serve pre_package);
for hook in ${hooks[@]}
do
mkdir "${hook}"
script="1_identify_hook.js"
file="${hook}/${script}"
echo '#!/usr/bin/env node' >> "${file}"
echo "console.log('#### HOOK: ${hook}');" >> "${file}"
chmod +x "${file}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment