Fixes & Updates - 2026-06-01: Integrate Back-End v3 updates, fix call/connection issues across apps
This commit is contained in:
83
compare.sh
Normal file
83
compare.sh
Normal file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
ORIG_FILE="lib/controller/home/map_passenger_controller.dart"
|
||||
SPLIT_DIR="lib/controller/home/map"
|
||||
|
||||
echo "Extracting methods from original controller..."
|
||||
# Methods typically start with spaces and have patterns like:
|
||||
# returnType methodName( or methodName(
|
||||
# Let's extract words that precede ( on lines that don't start with keywords (if, for, while, switch, catch, etc.)
|
||||
# We will use awk to parse.
|
||||
METHODS=$(cat "$ORIG_FILE" | awk '
|
||||
# Skip single-line comments
|
||||
/\/\// { next }
|
||||
# Skip imports and class declarations
|
||||
/import/ || /class/ { next }
|
||||
# Find lines with "("
|
||||
/\(/ {
|
||||
# Replace anything inside parentheses and curly braces to simplify
|
||||
gsub(/\(.*\)/, "()")
|
||||
# Find word before "()"
|
||||
for (i = 1; i <= NF; i++) {
|
||||
if ($i ~ /[a-zA-Z0-9_]+\(\)/) {
|
||||
name = $i
|
||||
sub(/\(\)/, "", name)
|
||||
# Remove any leading modifiers like async, Future, static, etc.
|
||||
# Only keep valid identifiers that are not control keywords
|
||||
if (name !~ /^(if|for|while|switch|catch|super|await|print|assert|dynamic|void|return|with|override|get|set|else|try|final|const|var|late|static|factory|new|abstract|covariant|external|operator|part|required|typedef|yield)$/ && name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
|
||||
print name
|
||||
}
|
||||
}
|
||||
}
|
||||
}' | sort -u)
|
||||
|
||||
echo "Extracting fields/variables from original controller..."
|
||||
# Fields are usually declared inside the class at the beginning of lines or indented.
|
||||
# e.g., RxBool isSearching = false.obs; or String? rideId;
|
||||
VARS=$(cat "$ORIG_FILE" | awk '
|
||||
/\/\// { next }
|
||||
/import/ || /class/ { next }
|
||||
# Lines ending with ";" or containing "=" followed by ";"
|
||||
/;/ {
|
||||
# Extract words that look like declarations.
|
||||
# We look for typical type names or var/final followed by variable name
|
||||
for (i = 1; i < NF; i++) {
|
||||
if ($i ~ /^(var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|IntaleqMapController)$/) {
|
||||
# The next field might be the variable name, or it might have a type like String?
|
||||
name = $(i+1)
|
||||
# Remove trailing ?, ;, =
|
||||
sub(/\?/, "", name)
|
||||
sub(/;/, "", name)
|
||||
sub(/=/, "", name)
|
||||
if (name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
|
||||
print name
|
||||
}
|
||||
}
|
||||
}
|
||||
}' | sort -u)
|
||||
|
||||
echo "Checking split files for methods..."
|
||||
echo "--- MISSING METHODS ---"
|
||||
MISSING_METHODS_COUNT=0
|
||||
for method in $METHODS; do
|
||||
# Search for this method name as a whole word in split controllers
|
||||
FOUND=$(grep -rw "$method" "$SPLIT_DIR" 2>/dev/null)
|
||||
if [ -z "$FOUND" ]; then
|
||||
echo " - $method"
|
||||
MISSING_METHODS_COUNT=$((MISSING_METHODS_COUNT+1))
|
||||
fi
|
||||
done
|
||||
echo "Total missing methods: $MISSING_METHODS_COUNT"
|
||||
|
||||
echo ""
|
||||
echo "Checking split files for variables/fields..."
|
||||
echo "--- MISSING VARIABLES ---"
|
||||
MISSING_VARS_COUNT=0
|
||||
for var in $VARS; do
|
||||
FOUND=$(grep -rw "$var" "$SPLIT_DIR" 2>/dev/null)
|
||||
if [ -z "$FOUND" ]; then
|
||||
echo " - $var"
|
||||
MISSING_VARS_COUNT=$((MISSING_VARS_COUNT+1))
|
||||
fi
|
||||
done
|
||||
echo "Total missing variables: $MISSING_VARS_COUNT"
|
||||
Reference in New Issue
Block a user