mirror of
https://github.com/BastilleBSD/templates.git
synced 2025-12-10 17:00:30 +01:00
24 lines
445 B
Bash
Executable File
24 lines
445 B
Bash
Executable File
#!/usr/bin/bash
|
|
git rev-parse --abbrev-ref HEAD > branch.txt
|
|
read -r BRANCH <"branch.txt"
|
|
echo $BRANCH
|
|
rm branch.txt
|
|
|
|
git diff --dirstat main $BRANCH ./* > diff.txt
|
|
echo "*** diff.txt ***"
|
|
cat diff.txt
|
|
|
|
# Use sed to remove characters before the match pattern
|
|
match_pattern=' '
|
|
sed "s/.*$match_pattern/$match_pattern/" "diff.txt" > changed.txt
|
|
|
|
echo "*** changed.txt ***"
|
|
cat changed.txt
|
|
|
|
read -r CHDIR <"changed.txt"
|
|
echo $CHDIR
|
|
|
|
cd $CHDIR
|
|
pwd
|
|
|