File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,22 @@ is_dry_run() {
81
81
fi
82
82
}
83
83
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
+
84
100
deprecation_notice () {
85
101
distro=$1
86
102
date=$2
@@ -283,6 +299,18 @@ do_install() {
283
299
lsb_dist=$( get_distribution )
284
300
lsb_dist=" $( echo " $lsb_dist " | tr ' [:upper:]' ' [:lower:]' ) "
285
301
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
+
286
314
case " $lsb_dist " in
287
315
288
316
ubuntu)
@@ -465,6 +493,15 @@ do_install() {
465
493
exit 0
466
494
;;
467
495
* )
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
468
505
echo
469
506
echo " ERROR: Unsupported distribution '$lsb_dist '"
470
507
echo
You can’t perform that action at this time.
0 commit comments