perf: install env checks

This commit is contained in:
2025-12-23 20:53:55 +02:00
parent a286817ce3
commit 891ae505f8
30 changed files with 492 additions and 490 deletions

View File

@@ -5,29 +5,24 @@
# Print SSH key.
#
# skip if CODESPACES is set
if [ -n "$CODESPACES" ]; then
log_warn "Running in a GitHub Codespace"
export SKIP_SSH_CONFIG=1
# Skip in Codespaces
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
# Skip if explicitly disabled
[[ -n "$SKIP_SSH_CONFIG" ]] && { log_warn "Skipping SSH configuration"; return 0; }
ssh_method="ed25519"
ssh_target="${HOME}/.ssh"
ssh_key="${ssh_target}/id_${ssh_method}"
ssh_pub="${ssh_key}.pub"
if [ ! -f "$ssh_key" ]; then
ssh-keygen \
-t "$ssh_method" \
-f "$ssh_key" \
-C "$(whoami)@$(hostname)-$(date -I)"
fi
# skip if SKIP_SSH_CONFIG is set
if [ -z "$SKIP_SSH_CONFIG" ]; then
ssh_method="ed25519"
cat "$ssh_pub"
ssh_target="${HOME}/.ssh"
ssh_key="${ssh_target}/id_${ssh_method}"
ssh_pub="${ssh_key}.pub"
if [ ! -f "$ssh_key" ]; then
ssh-keygen \
-t "$ssh_method" \
-f "$ssh_key" \
-C "$(whoami)@$(hostname)-$(date -I)"
fi
cat "$ssh_pub"
unset ssh_method ssh_target ssh_key ssh_pub
else
log_warn "Skipping SSH configuration"
fi
unset ssh_method ssh_target ssh_key ssh_pub