Added youki build and fromatting of scripts
This commit is contained in:
@@ -195,6 +195,26 @@ function get_file_size() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Get short git commit hash from a git repository directory
|
||||
function get_git_commit_hash() {
|
||||
local repo_dir="$1"
|
||||
local short="${2:-true}" # Default to short hash
|
||||
|
||||
if [[ ! -d "$repo_dir/.git" ]]; then
|
||||
echo "unknown"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local hash
|
||||
if [[ "$short" == "true" ]]; then
|
||||
hash=$(cd "$repo_dir" && git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
||||
else
|
||||
hash=$(cd "$repo_dir" && git rev-parse HEAD 2>/dev/null || echo "unknown")
|
||||
fi
|
||||
|
||||
echo "$hash"
|
||||
}
|
||||
|
||||
# Wait for file to exist with timeout
|
||||
function wait_for_file() {
|
||||
local file="$1"
|
||||
|
||||
Reference in New Issue
Block a user