mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-07-04 15:03:04 +02:00
fix: resolve shellcheck warnings
- lint_python.sh: remove unused VERBOSE variable, use OVERALL_STATUS for exit - run_game.sh: add || exit after cd - install_arch.sh/uninstall_arch.sh: separate local declaration and assignment - lint.sh: use variable for pkg-config output to avoid word splitting
This commit is contained in:
parent
5966821bad
commit
e2415dec05
@ -254,7 +254,8 @@ test_installation() {
|
||||
|
||||
# Test default application association
|
||||
if command -v xdg-mime &> /dev/null; then
|
||||
local default_app=$(xdg-mime query default image/jpeg 2>/dev/null)
|
||||
local default_app
|
||||
default_app=$(xdg-mime query default image/jpeg 2>/dev/null)
|
||||
if [[ "$default_app" == "imageviewer.desktop" ]]; then
|
||||
print_success "imageviewer is set as default image viewer"
|
||||
else
|
||||
|
||||
@ -115,8 +115,10 @@ compile_check() {
|
||||
print_step "Running compile check..."
|
||||
|
||||
# Try to compile with extra warnings
|
||||
local sdl_cflags
|
||||
sdl_cflags=$(pkg-config --cflags sdl2 2>/dev/null || echo "-I/usr/include/SDL2")
|
||||
if gcc -Wall -Wextra -Wpedantic -std=c99 -O2 \
|
||||
$(pkg-config --cflags sdl2 2>/dev/null || echo "-I/usr/include/SDL2") \
|
||||
${sdl_cflags} \
|
||||
-c main.c -o /tmp/main.o 2>/dev/null; then
|
||||
print_success "Compile check passed"
|
||||
rm -f /tmp/main.o
|
||||
@ -124,7 +126,7 @@ compile_check() {
|
||||
print_error "Compile check failed"
|
||||
print_step "Trying compile with detailed errors..."
|
||||
gcc -Wall -Wextra -Wpedantic -std=c99 -O2 \
|
||||
$(pkg-config --cflags sdl2 2>/dev/null || echo "-I/usr/include/SDL2") \
|
||||
${sdl_cflags} \
|
||||
-c main.c -o /tmp/main.o
|
||||
fi
|
||||
}
|
||||
|
||||
@ -79,7 +79,8 @@ reset_default_associations() {
|
||||
for mime_type in "${mime_types[@]}"; do
|
||||
if command -v xdg-mime &> /dev/null; then
|
||||
# Check if imageviewer was the default
|
||||
local current_default=$(xdg-mime query default "$mime_type" 2>/dev/null)
|
||||
local current_default
|
||||
current_default=$(xdg-mime query default "$mime_type" 2>/dev/null)
|
||||
if [[ "$current_default" == "imageviewer.desktop" ]]; then
|
||||
# Remove the association (this will fall back to system defaults)
|
||||
local mimeapps_file="$HOME/.config/mimeapps.list"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user