This commit is contained in:
pika 2025-05-20 21:07:42 +02:00
parent faee540985
commit b9175be395

View file

@ -63,11 +63,11 @@ checkAndInstall curl wget
2. Logging Functions: 2. Logging Functions:
echo_error "message" - Red error message `echo_error` "message" - Red error message </br>
echo_warning "message" - Yellow warning message `echo_warning` "message" - Yellow warning message </br>
echo_info "message" - Blue info message `echo_info` "message" - Blue info message </br>
echo_note "message" - Green note message `echo_note` "message" - Green note message </br>
echo_pkg type "message" - Special package-related messages `echo_pkg` type "message" - Special package-related messages
Types for echo_pkg: Types for echo_pkg:
@ -85,10 +85,10 @@ echo_pkg install "Installing package"
3. Utility Functions: 3. Utility Functions:
command_exists cmd - Checks if command exists (silent) `command_exists cmd` - Checks if command exists (silent) </br>
run cmd - Runs command with silent mode support `run cmd` - Runs command with silent mode support </br>
source_script url - Sources another script from URL or file `source_script url` - Sources another script from URL or file </br>
silentexec cmd - Runs command silently `silentexec cmd` - Runs command silently
Example: Example:
@ -105,18 +105,18 @@ source_script "https://example.com/script.sh"
For Debian/Ubuntu: For Debian/Ubuntu:
- Version codename variables: - Version codename variables:
$trixie (Debian 13) - `$trixie` (Debian 13)
$bookworm (Debian 12) - `$bookworm` (Debian 12)
$jammy (Ubuntu 22.04) - `$jammy` (Ubuntu 22.04)
$focal (Ubuntu 20.04) - `$focal` (Ubuntu 20.04)
For Fedora: For Fedora:
- Version variables like $fedora_40 for Fedora 40 - Version variables like `$fedora_40` for Fedora 40
For Arch: For Arch:
- $aur - true if yay/paru is available - `$aur` - `true` if yay/paru is available
### ADVANCED USAGE ### ADVANCED USAGE
@ -159,14 +159,14 @@ fi
2. Use the provided echo functions for consistent output 2. Use the provided echo functions for consistent output
3. For distro-specific code, check the boolean variables first 3. For distro-specific code, check the boolean variables first
4. Use arrays with checkAndInstall for multiple packages 4. Use arrays with checkAndInstall for multiple packages
5. Use source_script for modular script organization 5. Use `source_script` for modular script organization
### TROUBLESHOOTING ### TROUBLESHOOTING
If something doesn't work: If something doesn't work:
1. Check if /etc/os-release exists 1. Check if `/etc/os-release` exists
2. Verify internet connection for remote scripts 2. Verify internet connection for remote scripts
3. Check permissions (script handles sudo automatically) 3. Check permissions (script handles sudo automatically)
4. Verify $distro variable matches your system 4. Verify `$distro` variable matches your system
5. Check if required package managers are available 5. Check if required package managers are available