git archive-file: change base ARCHIVE_NAME (#1071)

Closes #1067

This makes the base ARCHIVE_NAME for `git-archive-file` to be the name
of the repo root directory instead of the name of the current directory.
This commit is contained in:
Austin Ziegler 2023-09-13 01:01:37 -04:00 committed by GitHub
parent cb29c62c65
commit db71be578e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,11 @@
#!/usr/bin/env bash
# extract current branch name
BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
# get name of the most top folder of current directory, used for the
# output filename
ARCHIVE_NAME=$(basename "$PWD")
ARCHIVE_NAME=$(basename "$(git rev-parse --show-toplevel)")
if [[ $BRANCH = tags* ]]; then
BRANCH=$(git describe)