This file contains 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
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[gray]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[green]%}⚡" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
function prompt_char { | |
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi | |
} | |
local current_dir='%{$fg[red]%}[%{$reset_color%} %{$fg_bold[yellow]%}%~% %{$reset_color%} %{$fg[red]%}]%{$reset_color%}' |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<apiVersion>47.0</apiVersion> | |
<isExposed>true</isExposed> | |
<masterLabel> The Name of the component in builder </masterLabel> | |
<description> *** Some Description *** </description> | |
<targets> // ALL Interaces | |
<target>lightning__RecordPage</target> | |
<target>lightning__AppPage</target> | |
<target>lightning__HomePage</target> |
This file contains 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
// command builder | |
let sfdxCommand = ' sfdx force:org:create'; | |
sfdxCommand += ' -d ' + this.props.numberOfDays; // --durationdays | |
sfdxCommand += ' -a ' + this.props.scratchOrgName; // --setalias | |
// will receieve this.options as input parameters from constructor | |
sfdxCommand += ' -f ' + this.options.projectFolder + '/config/scratch-org-def.json'; // --definitionfile | |
sfdxCommand += ' -v ' + this.options.devhubOrg; // -v | --targetdevhubusername | |
// will only assign as default if user wish to |
This file contains 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
prompting() { | |
// asking questions | |
const questions = [ | |
{ | |
type: 'checkbox', | |
name: 'mainMenu', | |
message: 'What would you like to do ?', | |
validate: function(choices) { | |
return choices.length > 0 ? true : chalk.redBright('Must Select at least one option'); |
This file contains 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
const Generator = require('yeoman-generator'); // this | |
const yosay = require('yosay'); // Yeoman Image | |
const chalk = require('chalk'); // color text | |
const shell = require('shelljs'); // shell commands | |
const spinner = require('ora'); // spinner | |
module.exports = class extends Generator { | |
initializing() { |
This file contains 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
alias dxcreate='sfdx force:org:create -d 30 -f config/project-scratch-def.json --setdefaultusername -a ' | |
alias dxpush='sfdx force:source:push -u ' | |
alias dxpull='sfdx force:source:pull -u ' | |
alias dxlist='sfdx force:org:list' | |
alias dxdelete='sfdx force:org:delete -u ' | |
alias dxopen='sfdx force:org:open -u ' | |
alias dxconnect='sfdx force:auth:web:login -a ' | |
alias dxconnectSB='sfdx force:auth:web:login -r https://test.salesforce.com -a ' |
This file contains 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
# Main App | |
// will pass input parameters to the sub generator | |
this.composeWith(require.resolve('../org-commands/org-create'),{ | |
devhubName : DevHub, | |
orgName : OrgName | |
}); | |
# Sub Generator | |
module.exports = class extends Generator { |
This file contains 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
{ | |
"country": "<%= orgLocal %>", | |
"language": "<%= orgLanguage %>", | |
"orgName": "<%= orgName %>", | |
"edition": "<%= orgEdition %>", | |
"adminEmail": "<%= adminEmail %>", | |
"hasSampleData": <%= hasSampleData %>, | |
"features": ["<%- orgFeatures %>"], | |
"settings": { |
This file contains 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
// this.props holds the answers values | |
writing() { | |
// Setting Features Selected | |
let features = this.props.orgFeatures.join("\",\""); | |
// Copy and populate scratch org defitnition file from a template | |
this.fs.copyTpl( | |
this.templatePath('config/scratch-org-def.json'), | |
this.destinationPath( this.props.projectName + '/config/scratch-org-def.json'), |
This file contains 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
async prompting() { | |
const menuQuestions = await this.prompt([ { | |
type: 'checkbox', | |
name: 'mainMenu', | |
message: 'What would you like to do?', | |
choices: [ | |
{ | |
name: ’option1', | |
value: ’option1', | |
checked: true |