-
Notifications
You must be signed in to change notification settings - Fork 0
/
library_vendor_setup.sh
executable file
·30 lines (24 loc) · 1.49 KB
/
library_vendor_setup.sh
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
#!/bin/bash
function scriptRootDir() {
#https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel/246128
# shellcheck disable=SC2005
echo "$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
}
libraryVendorPath="$(scriptRootDir)/library_vendor"
inputPath="$libraryVendorPath/input"
barkCppPath="$libraryVendorPath/bark_cpp_vendored/bark_cpp"
echo -e "\n\nDownloading external libraries ...\n"
vcs import "$libraryVendorPath" < "$libraryVendorPath"/libraries.repos || { echo "Failed to download external libraries !"; exit 1; }
pushd "$libraryVendorPath" || { echo "ERROR: Could not push into the '$libraryVendorPath' directory."; exit 1; }
vcs pull
popd || { echo "ERROR: Could not pop out of the '$libraryVendorPath' directory."; exit 1; }
echo -e "\n\nInitializing submodules for 'bark.cpp' ...\n"
pushd "$barkCppPath" || { echo "ERROR: Could not push into the '$barkCppPath' directory."; exit 1; }
git submodule update --init --recursive
popd || { echo "ERROR: Could not pop out of the '$barkCppPath' directory."; exit 1; }
echo -e "\n\nDownloading dependencies for 'input' ...\n"
vcs import "$inputPath" < "$inputPath"/libraries.repos || { echo "Failed to download dualsense library !"; exit 1; }
pushd "$inputPath" || { echo "ERROR: Could not push into the '$inputPath' directory."; exit 1; }
vcs pull
popd || { echo "ERROR: Could not pop out of the '$inputPath' directory."; exit 1; }
echo -e "\n\nAll libraries downloaded.\n"