forked from jsturtevant/copilot-codeact-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetect-backend.sh
More file actions
executable file
·35 lines (34 loc) · 865 Bytes
/
Copy pathdetect-backend.sh
File metadata and controls
executable file
·35 lines (34 loc) · 865 Bytes
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
#!/usr/bin/env bash
# detect-backend.sh — auto-pick codeact backend at install time.
# macOS → monty
# Linux + /dev/kvm → hyperlight
# Linux + /dev/mshv → hyperlight
# Linux (neither) → monty
# Windows + Hyper-V → hyperlight (via PowerShell check)
# Windows (no HV) → monty
set -euo pipefail
case "$(uname -s)" in
Darwin)
echo "monty"
;;
Linux)
if [[ -r /dev/kvm ]] || [[ -r /dev/mshv ]]; then
echo "hyperlight"
else
echo "monty"
fi
;;
MINGW*|MSYS*|CYGWIN*)
# Check for Hyper-V via PowerShell
if powershell.exe -NoProfile -Command \
"(Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V).State -eq 'Enabled'" \
2>/dev/null | grep -qi true; then
echo "hyperlight"
else
echo "monty"
fi
;;
*)
echo "monty"
;;
esac