Merge pull request #69 from outis1one/claude/fix-kiosk-issues-qlxTc

Fix upgrade: ensure dir exists, use sudo tee directly
This commit is contained in:
outis1one
2025-12-24 13:55:23 -05:00
committed by GitHub
+11 -3
View File
@@ -10549,6 +10549,13 @@ upgrade_kiosk() {
echo "[4/6] Extracting new app files from script..."
# Ensure kiosk directory exists with correct ownership
if [[ ! -d "$KIOSK_DIR" ]]; then
echo " Creating $KIOSK_DIR..."
sudo mkdir -p "$KIOSK_DIR"
fi
sudo chown "$KIOSK_USER:$KIOSK_USER" "$KIOSK_DIR"
# Helper function to extract heredoc content using line numbers
extract_file() {
local start_pattern="$1"
@@ -10579,13 +10586,14 @@ upgrade_kiosk() {
local content_start=$((start_line + 1))
local content_end=$((start_line + end_offset - 2))
sed -n "${content_start},${content_end}p" "$script_path" | sudo -u "$KIOSK_USER" tee "$output_file" > /dev/null
# Extract content and write to file (use sudo tee for reliability)
sed -n "${content_start},${content_end}p" "$script_path" | sudo tee "$output_file" > /dev/null
if [[ -s "$output_file" ]]; then
echo "$fname"
echo "$fname (lines $content_start-$content_end)"
return 0
else
echo "$fname (empty)"
echo "$fname (extracted 0 lines from $content_start-$content_end)"
return 1
fi
}