32 lines
732 B
Bash
32 lines
732 B
Bash
#!/bin/bash
|
|
|
|
# Get the current directory name
|
|
CURRENT_DIR_NAME=$(basename "$PWD")
|
|
|
|
# Define the files to be updated
|
|
FILES=("main.go" "go.mod" "wails.json")
|
|
|
|
# String to be replaced
|
|
OLD_STRING="wails-template"
|
|
|
|
# Loop through the files and replace occurrences of the old string
|
|
for file in "${FILES[@]}"; do
|
|
if [[ -f "$file" ]]; then
|
|
sed -i "s/${OLD_STRING}/${CURRENT_DIR_NAME}/g" "$file"
|
|
echo "Updated: $file"
|
|
else
|
|
echo "File not found: $file"
|
|
fi
|
|
done
|
|
|
|
|
|
#### finalize wails.json
|
|
|
|
USER_NAME=$(git config user.name)
|
|
USER_EMAIL=$(git config user.email)
|
|
|
|
sed -i "s/schreifuchs/${USER_NAME}/g" "wails.json"
|
|
sed -i "s/kontakt@schreifuchs.ch/${USER_EMAIL}/g" "wails.json"
|
|
|
|
echo "You are rady to gooooo"
|