21 lines
475 B
Bash
Executable File
21 lines
475 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
source "$(dirname "$0")/../common.sh"
|
|
|
|
print_info "Available generations:"
|
|
darwin-rebuild --list-generations
|
|
|
|
echo -n "Enter generation number to rollback to: "
|
|
read -r GEN_NUM
|
|
|
|
if [[ -z "$GEN_NUM" ]]; then
|
|
print_error "No generation number provided"
|
|
exit 1
|
|
fi
|
|
|
|
print_warning "Rolling back to generation $GEN_NUM..."
|
|
darwin-rebuild switch --switch-generation "$GEN_NUM"
|
|
|
|
print_success "Rollback to generation $GEN_NUM complete"
|