Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dosbox-staging/dosbox-staging.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkcgen <kcgen@users.noreply.github.com>2022-03-26 01:31:44 +0300
committerkcgen <1557255+kcgen@users.noreply.github.com>2022-03-26 19:20:35 +0300
commita8c654b370010a42e74dd8923f047b1efc8811c5 (patch)
treecdbce9d0b2f4895aa034cab62f16c12a69d4e70f /scripts
parent0fd275e34c1c923002809ea7738bcca85fd2a82c (diff)
Add local git metadata to the install script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-package.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/create-package.sh b/scripts/create-package.sh
index 3b5e1e5d5..ac884ad0c 100755
--- a/scripts/create-package.sh
+++ b/scripts/create-package.sh
@@ -175,10 +175,17 @@ pkg_msvc()
# Get GitHub CI environment variables if available. The CLI options
# '-c', '-b', '-r' will override these if set.
-git_commit=$GITHUB_SHA
-git_branch=${GITHUB_REF#refs/heads/}
-git_repo=$GITHUB_REPOSITORY
+if [ -n "${GITHUB_REPOSITORY:-}" ]; then
+ git_commit=${GITHUB_SHA}
+ git_branch=${GITHUB_REF#refs/heads/}
+ git_repo=${GITHUB_REPOSITORY}
+else
+ git_commit=$(git rev-parse --short HEAD || echo '')
+ git_branch=$(git rev-parse --abbrev-ref HEAD || echo '')
+ git_repo=$(basename "$(git rev-parse --show-toplevel)" || echo '')
+fi
+print_usage="false"
while getopts 'p:c:b:r:v:hf' c
do
case $c in