-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathdevelop.sh
More file actions
executable file
·56 lines (51 loc) · 1.58 KB
/
Copy pathdevelop.sh
File metadata and controls
executable file
·56 lines (51 loc) · 1.58 KB
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
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -e
CLI_NAME="$(basename "${BASH_SOURCE[0]}")"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
REPO_NAME="$(basename "$(dirname "${DIR}")")"
DEFAULT_ALIAS="${REPO_NAME}-dev"
_help() {
echo "${CLI_NAME}."
echo ""
echo "> Setup an environment for development."
echo ""
echo "Usage:"
echo " ${CLI_NAME} [-a SETALIAS]"
echo ""
echo "Options:"
echo " -h --help show help"
echo " -a --setalias SETALIAS set an alias for for the created scratch org (default: ${DEFAULT_ALIAS})"
echo ""
echo "Examples:"
echo " View this help text"
echo " $ ${CLI_NAME} -h"
echo ""
echo " Spin up and configure a scratch org"
echo " $ ${CLI_NAME}"
echo ""
echo " Spin up and configure a scratch org with the given alias (one alphanumerical word, may contain '-_')"
echo " $ ${CLI_NAME} -a myfeature"
}
_main() {
alias="${alias:-${DEFAULT_ALIAS}}"
# shellcheck disable=SC2068
sf org create scratch -f config/project-scratch-def.json \
--alias "$alias" \
--set-default \
${POSITIONAL_ARGS[@]}
if [[ "${CPQ}" == "true" ]]; then
# Salesforce CPQ (SBQQ) 260.2
# https://install.steelbrick.com/
sf package install --package "04tKh000001zrocIAA" --no-prompt --wait 30
fi
}
if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then
set -eo pipefail
POSITIONAL_ARGS=()
while [[ "$#" -gt 0 ]]; do case $1 in
-h|--help) _help; exit 0;;
-a|--setalias) alias="$2"; shift 2;;
*) POSITIONAL_ARGS+=("$1"); shift;;
esac; done
_main "${POSITIONAL_ARGS[@]}"
fi