Skip to content

Instantly share code, notes, and snippets.

@vyuvalv
Last active November 3, 2019 10:46
Show Gist options
  • Save vyuvalv/08855c36b68e5d182409b9be7fd5abf5 to your computer and use it in GitHub Desktop.
Save vyuvalv/08855c36b68e5d182409b9be7fd5abf5 to your computer and use it in GitHub Desktop.
Sample of `Hello world` Generator main file js
const Generator = require('yeoman-generator'); // this
const yosay = require('yosay'); // yeoman ascii image
const chalk = require('chalk'); // color text
const shell = require('shelljs'); // shell commands
module.exports = class extends Generator {
initializing() {
// Use this.log instead of console.log
this.log( yosay( chalk.red("Hello World") ) );
// Invoke sfdx commands to map connected orgs using shelljs
shell.exec('sfdx force:org:list');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment