Created
April 16, 2025 19:12
-
-
Save mickaelxd/5b990104cb427c355f5eb1b1b6b01a51 to your computer and use it in GitHub Desktop.
Script que lê arquivos de texto do projeto, joga tudo no `output.txt` junto com um pedido final pra refatorar e devolver um arquivo .sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "" > output.txt | |
process_folder() { | |
local folder=$1 | |
find "$folder" -type f | while read file; do | |
# Verifica se é um arquivo de texto (text/* no mime-type) | |
if file --mime-type "$file" | grep -q '^.*: text/'; then | |
echo "File: $file" >> output.txt | |
cat "$file" >> output.txt | |
echo "------------------------" >> output.txt | |
fi | |
done | |
} | |
process_file() { | |
local file=$1 | |
# Verifica se é um arquivo de texto (text/* no mime-type) | |
if file --mime-type "$file" | grep -q '^.*: text/'; then | |
echo "File: $file" >> output.txt | |
cat "$file" >> output.txt | |
echo "------------------------" >> output.txt | |
fi | |
} | |
process_file android/app/src/main/kotlin/com/example/app/MainActivity.kt | |
process_file android/app/src/main/AndroidManifest.xml | |
process_file ios/Runner/AppDelegate.swift | |
process_file ios/Runner/Info.plist | |
process_file ios/Podfile | |
process_file pubspec.yaml | |
process_folder lib | |
process_file docs/geolocator.md | |
cat <<EOF >> output.txt | |
**Prompt:** | |
Remove any implementation related to custom background services. | |
Implement all background location and distance/timer tracking using the 'geolocator' package only. | |
The goal is to ensure continuous tracking of distance and timer using geolocator, both when the app is in foreground and background, on Android and iOS. | |
**Rules:** | |
Do not change the layout of any screen. | |
Remove everything related to custom background service. | |
Implement location tracking with 'geolocator' so that it works seamlessly in both foreground and background. | |
Update pubspec.yaml with any required permissions and packages. | |
Do not add comments; remove all comments from the code you modify. | |
Ensure correct configuration for location permissions and background mode on both platforms. | |
**Response:** | |
Think about the output. | |
Return an 'apply_changes.sh' script recreating all necessary files with the changes made. | |
Do not return unchanged files. | |
The script must be executable. | |
Do not return anything other than the script file. | |
EOF | |
echo "All readable text files have been written to output.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment