forked from external/yambar
generate-version: check for .git directory in *src* dir
Instead of trying to run `git --rev-parse --is-inside-work-tree`, check if there's a .git directory under the source directory. This should fix an issue where we incorrectly decided we where in a foot git clone when we're just a subdirectory under another repository.
This commit is contained in:
parent
6af8b52012
commit
d68785eb2b
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ out_file=${3}
|
||||||
# echo "source directory: ${src_dir}"
|
# echo "source directory: ${src_dir}"
|
||||||
# echo "output file: ${out_file}"
|
# echo "output file: ${out_file}"
|
||||||
|
|
||||||
if command -v git > /dev/null && git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
|
if [ -d "${src_dir}/.git" ] && command -v git > /dev/null; then
|
||||||
workdir=$(pwd)
|
workdir=$(pwd)
|
||||||
cd "${src_dir}"
|
cd "${src_dir}"
|
||||||
git_version=$(git describe --always --tags)
|
git_version=$(git describe --always --tags)
|
||||||
|
|
Loading…
Add table
Reference in a new issue