(isBuildServer = false)
| 107 | }; |
| 108 | |
| 109 | export const defaultCommand = (isBuildServer = false) => { |
| 110 | const bashCommand = ` |
| 111 | set -e; |
| 112 | DOCKER_VERSION=28.5.0 |
| 113 | OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') |
| 114 | SYS_ARCH=$(uname -m) |
| 115 | CURRENT_USER=$USER |
| 116 | |
| 117 | echo "Installing requirements for: OS: $OS_TYPE" |
| 118 | |
| 119 | # Auto-detect sudo requirement |
| 120 | if [ "$EUID" -eq 0 ]; then |
| 121 | SUDO_CMD="" |
| 122 | echo "Running as root" |
| 123 | else |
| 124 | if sudo -n true 2>/dev/null; then |
| 125 | SUDO_CMD="sudo" |
| 126 | echo "Running as $CURRENT_USER with sudo privileges" |
| 127 | else |
| 128 | echo "Error: Non-root user requires passwordless sudo access. ❌" |
| 129 | echo "Configure with: echo '$CURRENT_USER ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/$CURRENT_USER" |
| 130 | exit 1 |
| 131 | fi |
| 132 | fi |
| 133 | |
| 134 | # Check if the OS is manjaro, if so, change it to arch |
| 135 | if [ "$OS_TYPE" = "manjaro" ] || [ "$OS_TYPE" = "manjaro-arm" ]; then |
| 136 | OS_TYPE="arch" |
| 137 | fi |
| 138 | |
| 139 | # Check if the OS is Asahi Linux, if so, change it to fedora |
| 140 | if [ "$OS_TYPE" = "fedora-asahi-remix" ]; then |
| 141 | OS_TYPE="fedora" |
| 142 | fi |
| 143 | |
| 144 | # Check if the OS is popOS, if so, change it to ubuntu |
| 145 | if [ "$OS_TYPE" = "pop" ]; then |
| 146 | OS_TYPE="ubuntu" |
| 147 | fi |
| 148 | |
| 149 | # Check if the OS is linuxmint, if so, change it to ubuntu |
| 150 | if [ "$OS_TYPE" = "linuxmint" ]; then |
| 151 | OS_TYPE="ubuntu" |
| 152 | fi |
| 153 | |
| 154 | #Check if the OS is zorin, if so, change it to ubuntu |
| 155 | if [ "$OS_TYPE" = "zorin" ]; then |
| 156 | OS_TYPE="ubuntu" |
| 157 | fi |
| 158 | |
| 159 | if [ "$OS_TYPE" = "arch" ] || [ "$OS_TYPE" = "archarm" ]; then |
| 160 | OS_VERSION="rolling" |
| 161 | else |
| 162 | OS_VERSION=$(grep -w "VERSION_ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') |
| 163 | fi |
| 164 | |
| 165 | if [ "$OS_TYPE" = 'amzn' ]; then |
| 166 | $SUDO_CMD dnf install -y findutils >/dev/null |
no test coverage detected