-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
pushkraft
executable file
·48 lines (38 loc) · 1.62 KB
/
pushkraft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Check if the script is run from the root of the PasVulkan GIT repository by checking if the .git directory is present
if [ ! -d ".git" ]; then
echo "This script must be run from the root of the PasVulkan GIT repository"
exit 1
fi
# Check if the script is run from the original author by checking if the home directory /home/bero is present, which is the home directory of the original author
if [ ! -d "/home/bero" ]; then
echo "This script must be run only from the original author"
exit 1
fi
# Save the current directory in a variable
OLD_DIR="$(pwd)"
# Copy modified files from the kraft submodule to the real directory of the kraft GIT repository
cp -f externals/kraft/README.md ../kraft/README.md
cp -f externals/kraft/src/kraft.pas ../kraft/src/kraft.pas
cp -f externals/kraft/src/KraftArcadeCarPhysics.pas ../kraft/src/KraftArcadeCarPhysics.pas
cp -f externals/kraft/src/KraftRayCastVehicle.pas ../kraft/src/KraftRayCastVehicle.pas
# Clean the kraft submodule from the local changes
cd externals/kraft
git stash # Stash the local changes
git stash drop # Drop the stashed local changes
git pull origin master # For ensuring that the local kraft submodule is on the right branch
cd "${OLD_DIR}"
# Commit the changes in the kraft GIT repository
cd ../kraft
git commit -a -m "Updated kraft"
git push
cd "${OLD_DIR}"
# Update all submodules including the kraft submodule for the lastest versions
git submodule update --remote --recursive
# Commit the changes in the main PasVulkan GIT repository
git commit -am "Updated submodules"
git push
# Switch to the old directory back
cd "${OLD_DIR}"
# Exit with success
exit 0