forked from trailheadapps/lwc-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-scratch.sh
executable file
·47 lines (37 loc) · 991 Bytes
/
install-scratch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd $SCRIPT_PATH/..
# Set parameters
ORG_ALIAS="recipes"
echo ""
echo "Installing LWC Recipes scratch org ($ORG_ALIAS)"
echo ""
# Install script
echo "Cleaning previous scratch org..."
sfdx force:org:delete -p -u $ORG_ALIAS &> /dev/null
echo ""
echo "Creating scratch org..." && \
sfdx force:org:create -s -f config/project-scratch-def.json -d 30 -a $ORG_ALIAS && \
echo "" && \
echo "Pushing source..." && \
sfdx force:source:push && \
echo "" && \
echo "Assigning permission sets..." && \
sfdx force:user:permset:assign -n recipes && \
echo "" && \
echo "Importing sample data..." && \
sfdx force:data:tree:import -p data/data-plan.json && \
echo "" && \
echo "Opening org..." && \
sfdx force:org:open -p lightning/n/Hello && \
echo ""
EXIT_CODE="$?"
echo ""
# Check exit code
echo ""
if [ "$EXIT_CODE" -eq 0 ]; then
echo "Installation completed."
else
echo "Installation failed."
fi
exit $EXIT_CODE