File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # # #ddev-generated
4+ # # Description: Open a browser with the launch site or a specific TYPO3 version.
5+ # # Usage: launch
6+ # # Example: "ddev launch" or "ddev launch 13" or "ddev launch 13 /typo3"
7+
8+ . .ddev/.typo3-setup/scripts/.utils.sh
9+
10+ if [ " ${DDEV_PROJECT_STATUS} " != " running" ] && [ -z " $no_recursion " ]; then
11+ message yellow " Project ${DDEV_PROJECT} is not running, starting it"
12+ ddev start
13+ start_exit_code=$?
14+ if [ $start_exit_code -ne 0 ]; then
15+ exit $start_exit_code
16+ fi
17+ no_recursion=true ddev " $( basename " $0 " ) " " $@ "
18+ exit $?
19+ fi
20+
21+ VERSION=$1
22+ shift
23+
24+ if [ -z " $VERSION " ]; then
25+ FULLURL=${DDEV_PRIMARY_URL}
26+ else
27+ HOSTNAMES=$( printenv DDEV_HOSTNAME)
28+
29+ IFS=' ,' read -ra ADDR <<< " $HOSTNAMES"
30+ for i in " ${ADDR[@]} " ; do
31+ if [[ $i == ${VERSION} .* ]]; then
32+ FULLURL=" https://$i "
33+ break
34+ fi
35+ done
36+
37+ if [ -z " $FULLURL " ]; then
38+ message red " No matching URL found for version ${VERSION} "
39+ exit 1
40+ fi
41+
42+ if [ -n " ${1:- } " ]; then
43+ FULLURL=" ${FULLURL%/ } /${1#/ } "
44+ fi
45+ fi
46+
47+ case $OSTYPE in
48+ linux-gnu)
49+ if [[ ! -z " ${GITPOD_INSTANCE_ID} " ]]; then
50+ gp preview ${FULLURL}
51+ else
52+ xdg-open ${FULLURL}
53+ fi
54+ ;;
55+ " darwin" * )
56+ open ${FULLURL}
57+ ;;
58+ " win*" * | " msys" * )
59+ start ${FULLURL}
60+ ;;
61+ esac
You can’t perform that action at this time.
0 commit comments