Initial commit.

This commit is contained in:
pztrn committed 2023-03-04 00:49:28 +05:00
commit 364d2fd412
15 files changed
+1236

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
function git_source() {
local source_dir_name=$1
local source_dir="${ROOTDIR}/src/${source_dir_name}"
local remote_repo=$2
if [ ! -d "${source_dir}" ]; then
echo "* Creating source directory '${source_dir_name}'..."
if ! mkdir -p "${source_dir}"; then
echo "! Failed to create '${source_dir_name}'!"
exit 1
fi
fi
if ! cd "${source_dir}"; then
echo "! Failed to change current directory to '${source_dir}'!"
exit 1
fi
if [ ! -d ".git" ]; then
echo "* Getting sources in '${source_dir_name}'..."
if ! git clone "${remote_repo}" .; then
echo "! Failed to get sources in '${source_dir_name}'!"
exit 1
fi
else
echo "* Updating sources in '${source_dir_name}'..."
if ! git pull; then
echo "! Failed to update sources in '${source_dir_name}'!"
fi
fi
}