File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,22 @@ is_dry_run() {
8181 fi
8282}
8383
84+ is_wsl () {
85+ case " $( uname -r) " in
86+ * microsoft* ) true ;; # WSL 2
87+ * Microsoft* ) true ;; # WSL 1
88+ * ) false ;;
89+ esac
90+ }
91+
92+ is_darwin () {
93+ case " $( uname -s) " in
94+ * darwin* ) true ;;
95+ * Darwin* ) true ;;
96+ * ) false ;;
97+ esac
98+ }
99+
84100deprecation_notice () {
85101 distro=$1
86102 date=$2
@@ -283,6 +299,18 @@ do_install() {
283299 lsb_dist=$( get_distribution )
284300 lsb_dist=" $( echo " $lsb_dist " | tr ' [:upper:]' ' [:lower:]' ) "
285301
302+ if is_wsl; then
303+ echo
304+ echo " WSL DETECTED: We recommend using Docker Desktop for Windows."
305+ echo " Please get Docker Desktop from https://www.docker.com/products/docker-desktop"
306+ echo
307+ cat >&2 << -'EOF '
308+
309+ You may press Ctrl+C now to abort this script.
310+ EOF
311+ ( set -x; sleep 20 )
312+ fi
313+
286314 case " $lsb_dist " in
287315
288316 ubuntu)
@@ -465,6 +493,15 @@ do_install() {
465493 exit 0
466494 ;;
467495 * )
496+ if [ -z " $lsb_dist " ]; then
497+ if is_darwin; then
498+ echo
499+ echo " ERROR: Unsupported operating system 'macOS'"
500+ echo " Please get Docker Desktop from https://www.docker.com/products/docker-desktop"
501+ echo
502+ exit 1
503+ fi
504+ fi
468505 echo
469506 echo " ERROR: Unsupported distribution '$lsb_dist '"
470507 echo
You can’t perform that action at this time.
0 commit comments