mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Add IS_WSL2 export to runtime.sh and replace all inline grep-based WSL2 guards in administration scripts with a source + variable check for consistency. Affected scripts: - scripts/administration/systemd/enable/wsl2.sh - scripts/administration/tls/trust/wsl2.sh - scripts/administration/network/dns/setup/wsl.sh Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
620 B
Bash
Executable File
32 lines
620 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
#
|
|
# Resolve runtime context flags (local, act, github).
|
|
|
|
set -euo pipefail
|
|
|
|
if [[ "${INFINITO_ENV_RUNTIME_LOADED:-}" == "1" ]]; then
|
|
return 0
|
|
fi
|
|
export INFINITO_ENV_RUNTIME_LOADED="1"
|
|
|
|
: "${RUNNING_ON_ACT:=false}"
|
|
: "${RUNNING_ON_GITHUB:=false}"
|
|
|
|
if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
|
|
RUNNING_ON_GITHUB="true"
|
|
if [[ "${ACT:-}" == "true" ]]; then
|
|
RUNNING_ON_ACT="true"
|
|
RUNNING_ON_GITHUB="false"
|
|
fi
|
|
fi
|
|
|
|
export RUNNING_ON_ACT RUNNING_ON_GITHUB
|
|
|
|
if grep -qiE "microsoft|wsl" /proc/version 2>/dev/null; then
|
|
IS_WSL2="true"
|
|
else
|
|
IS_WSL2="false"
|
|
fi
|
|
export IS_WSL2
|