acecalisto3 commited on
Commit
fd8c0e4
Β·
1 Parent(s): aab8343
Files changed (1) hide show
  1. fix.sh +10 -11
fix.sh CHANGED
@@ -1,18 +1,17 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- echo "πŸ”§ Removing Rtf15Reader import from app2.py..."
5
- sed -i '/from pyth.plugins.rtf15.reader import Rtf15Reader/d' /home/user/app/app2.py
6
- echo "βœ… Import removed."
7
 
8
- echo "πŸ”§ Disabling .rtf file processing..."
9
 
10
- # Safely disable .rtf handling inside file processor
11
- sed -i '/if file_ext == ".rtf":/{
12
- n
13
- a\ processing_status_messages.append(f"⚠️ Skipping RTF file {file.name} because RTF processing is disabled.")\n continue
14
- }' /home/user/app/app2.py
15
 
16
- echo "βœ… RTF files now skipped safely."
 
17
 
18
- echo "🎯 All pyth dependencies fully removed and app2.py is adjusted. Restart your app now."
 
 
 
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ TARGET_FILE="/home/user/app/app2.py"
 
 
5
 
6
+ echo "πŸ” Normalizing indentation in $TARGET_FILE..."
7
 
8
+ # 1. Convert ALL tabs in the entire file into 4 spaces
9
+ expand --tabs=4 "$TARGET_FILE" > "${TARGET_FILE}.fixed"
 
 
 
10
 
11
+ # 2. Replace original file with fixed version
12
+ mv "${TARGET_FILE}.fixed" "$TARGET_FILE"
13
 
14
+ # 3. Double check for stray carriage returns (\r), just in case
15
+ sed -i 's/\r$//' "$TARGET_FILE"
16
+
17
+ echo "βœ… All tabs converted to spaces, indentation clean. Retrying app launch should now succeed."