Skip to content

Instantly share code, notes, and snippets.

@dcarroll
Created August 3, 2017 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dcarroll/dd3124b14d12adf9ecd000a90079055b to your computer and use it in GitHub Desktop.
Save dcarroll/dd3124b14d12adf9ecd000a90079055b to your computer and use it in GitHub Desktop.
Commands to demo SFDX
#!/bin/bash
function prompt {
echo ""
echo $1
}
prompt "Create project workspace..."
sfdx force:project:create -n Demo
cd Demo
prompt "Create a scratch org..."
sfdx force:org:create -s -a Demo -f config/project-scratch-def.json
prompt "Check the source status..."
sfdx force:source:status
prompt "Create a lightning component"
sfdx force:lightning:component:create -n MyComp -d force-app/main/default/aura/
prompt "Push the source..."
sfdx force:source:push
prompt "Check the source status..."
sfdx force:source:status
prompt "Pull in some open source DX source..."
echo "git clone https://github.com/dcarroll/YelpDemo"
git clone https://github.com/dcarroll/YelpDemo
prompt "Swith to the source branch of this component..."
cd YelpDemo
echo "git checkout source"
git checkout source
cd ..
prompt "Add the YelpDemo folder to the packageDirctories in the project.json..."
cat sfdx-project.json | jq '.packageDirectories |= .+ [{"path": "YelpDemo", "default": false}]' > new.json
cat new.json > sfdx-project.json
prompt "Push the new component to the scratch org..."
sfdx force:source:push
prompt "Check the source status..."
sfdx force:source:status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment