Created
April 16, 2019 18:26
-
-
Save ErisDS/3a9132089955b2698135257a72fa30cb to your computer and use it in GitHub Desktop.
Extending sywac dynamically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const prettyCLI = require('@tryghost/pretty-cli'); | |
const slimer = require('@tryghost/slimer'); | |
const extensions = require('../extensions'); | |
// Require internal commands | |
prettyCLI.commandDirectory('../commands'); | |
slimer | |
.loadCommands() | |
.then((commands) => { | |
commands.forEach((command) => { | |
// Load either our extended command, or the original | |
prettyCLI.command(extensions[command.id] ? extensions[command.id](command) : command); | |
}); | |
prettyCLI.parseAndExit(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment