Skip to content

Instantly share code, notes, and snippets.

@pateketrueke
Last active December 4, 2018 03:58
Show Gist options
  • Save pateketrueke/7f473b462ca7ecd3f648853ba6e44e2a to your computer and use it in GitHub Desktop.
Save pateketrueke/7f473b462ca7ecd3f648853ba6e44e2a to your computer and use it in GitHub Desktop.
Hakifile.js example
module.exports = haki => {
haki.setGenerator('the:truth', {
description: "Display if it's true, or not",
arguments: ['verb', 'value'],
abortOnFail: true,
actions(input) {
const { verb, value } = input;
if (verb === 'is' && parseInt(value, 10) === 42) {
console.log('Gotcha!');
return;
}
throw new Error('Is not true');
},
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment