-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
45 lines (38 loc) · 1.33 KB
/
update.sh
File metadata and controls
45 lines (38 loc) · 1.33 KB
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
#!/bin/bash
echo "Updating Git repository..."
git config pull.ff only
git pull
# Update pokeyslib
echo "Updating pokeyslib..."
cd ../pokeyslib
git config pull.ff only
git pull
# Build and install
echo "Building and installing pokeyslib"
make -f Makefile.noqmake install
cd -
# Add caching mechanism for dependencies
cache_dir="$HOME/.cache/linuxcnc"
mkdir -p "$cache_dir"
export CCACHE_DIR="$cache_dir"
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=6
export CCACHE_MAXSIZE=5G
export PATH="/usr/lib/ccache:$PATH"
# Get the directory of the current script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Execute the compile.sh script
echo "Executing compile.sh script..."
/bin/bash "${SCRIPT_DIR}/compile.sh" 2>&1 | tee compile.log
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
echo "Compile failed. Check the log file for details: compile.log"
exit 1
fi
# Ensure that the folder for example configs is existing
if [ ! -d "/usr/share/doc/linuxcnc/examples/sample-configs/by_interface/pokeys" ]; then
echo "Creating folder for example configs..."
mkdir -p /usr/share/doc/linuxcnc/examples/sample-configs/by_interface/pokeys
fi
# Copy the example configs to the correct folder
echo "Copying example configs to the correct folder..."
cp -r "./DM542_XXYZ_mill" /usr/share/doc/linuxcnc/examples/sample-configs/by_interface/pokeys