3 Commits
Author SHA1 Message Date
demus 5bc2518cce Extract list of sources from spec file if available 2026-07-03 11:22:03 +02:00
demus a526626df1 Check for at least one of git or find and complain 2026-06-12 17:58:40 +02:00
demus d1d8aafca0 More option validation to simplify non-go-vendor-tools enabled scenarios
Test actual contents of sources
2026-06-12 16:33:13 +02:00
6 changed files with 281 additions and 104 deletions
+105 -66
View File
@@ -5,9 +5,51 @@
# * COPR source file
shopt -s extglob
__has_spec_file() {
test -n "$SPEC_FILE"
}
__is_vendor_enabled() {
__has_spec_file && grep -q go-vendor-tools.toml "$SPEC_FILE"
}
# shellcheck disable=SC2046,SC2086
__find_sources() {
if [ -n "$SOURCES_FILE" ] && [ -d "$(dirname $SOURCES_FILE)" ] && [ "$PWD" != "$(dirname $SOURCES_FILE)" ]; then
DO_POP=1
pushd "$(dirname $SOURCES_FILE)" > /dev/null || exit 98
fi
if __has_spec_file; then
SPECTOOL_SOURCES="$(spectool --list-files --sources "$SPEC_FILE")"
if [ $? -ne 0 ]; then
echo "The spec file $SPEC_FILE couldn't be parsed"
exit 96
fi
FILTERED_SOURCES="$(echo "$SPECTOOL_SOURCES" | sed -e '/^Source[0-9]*:[[:blank:]]*sources/d' -e 's/^Source[0-9]*:[[:blank:]]*//')"
if [ -n "$FILTERED_SOURCES" ]; then
FILENAMES=$(basename -a "$FILTERED_SOURCES")
fi
elif [ -d .git ] && which git &>/dev/null; then
FILENAMES=$(git ls-files --exclude-standard | grep -v -e '^\.' -e sources)
elif which find &>/dev/null; then
FILENAMES=$(find . -path "./RPMS" -prune -o -path "./BUILD" -prune -o -path "./SRPMS" -prune -o -path "./.*" -prune -o \( ! \( -name '*.spec' -o -name '.*' -o -name sources \) -a -type f \) -printf ' %P')
else
echo "No way to search for relevant source files was found. Please install find (and git if this is a git repository directory) or add a .spec file to the directory."
exit 97
fi
if [[ "$DO_POP" -eq 1 ]]; then
popd > /dev/null || echo $FILENAMES
fi
echo $FILENAMES
}
_usage() {
echo "Usage: $(basename "$0") [OPTION]... <SPEC_FILE>"
echo "Update generated artifacts belonging to the <SPEC_FILE>."
echo "Usage: $(basename "$0") [OPTION]... [<SPEC_FILE>]"
echo "Update generated artifacts. If <SPEC_FILE> is specified the referenced sources and artifacts are processed"
echo " otherwise a source file is created or updated in the current directory or in the directory the source"
echo " file parameter points to."
echo
echo "Options:"
echo " -a Update archive"
@@ -17,7 +59,9 @@ _usage() {
echo " -u Ignore unlicensed mods. Implies -l"
echo " -h Print this message and exit"
echo
echo "If none of the update operations are specified, all of them will be performed."
echo "If none of the update operations are specified, all of them will"
echo "be performed unless the spec is not go-vendor-tools enabled,"
echo "in which case only the sources file will be updated."
}
_parse_args() {
@@ -46,70 +90,79 @@ _parse_args() {
echo "Option -$OPTARG is invalid"
echo
_usage
exit 10
exit 9
;;
esac
done
if [ "$UPDATE_ARCHIVE" == "" ] && [ "$UPDATE_LICENSES" == "" ] && [ "$UPDATE_SOURCES" == "" ]; then
UPDATE_ARCHIVE=1
UPDATE_LICENSES=1
UPDATE_SOURCES=1
fi
if [ "$IGNORE_UNLICENSED_ARG" != "" ] && [ "$UPDATE_LICENSES" == "" ]; then
UPDATE_LICENSES=1
fi
if [ "$SOURCES_FILE" != "" ] && [ "$UPDATE_SOURCES" == "" ]; then
UPDATE_SOURCES=1
fi
# Validate required positional .spec file value
SPEC_FILE="${@:$OPTIND:1}"
if [ "$SPEC_FILE" == "" ]; then
echo "The required spec parameter is missing"
echo
_usage
exit 1
if __has_spec_file; then
if ! [[ "$SPEC_FILE" =~ .*.\.spec$ ]]; then
echo "The spec file $SPEC_FILE doesn't have a .spec extension"
echo
_usage
exit 2
fi
if [ ! -f "$SPEC_FILE" ]; then
echo "The spec file $SPEC_FILE is not readable"
echo
_usage
exit 3
fi
fi
if ! [[ "$SPEC_FILE" =~ .*.\.spec$ ]]; then
echo "The spec file $SPEC_FILE doesn't have a .spec extension"
echo
_usage
exit 2
fi
if [ ! -f "$SPEC_FILE" ]; then
echo "The spec file $SPEC_FILE is not readable"
echo
_usage
exit 3
fi
}
_download_sources() {
if [ ! -v SPEC_FILE ]; then
echo ERROR: Variable SPEC_FILE in not set
exit 99
# Default UPDATE_ vars if no particular operation was requested
if [ -z "$UPDATE_ARCHIVE" ] && [ -z "$UPDATE_LICENSES" ] && [ -z "$UPDATE_SOURCES" ]; then
if __is_vendor_enabled; then
UPDATE_ARCHIVE=1
UPDATE_LICENSES=1
fi
UPDATE_SOURCES=1
fi
# Set implied vars
if [ -n "$IGNORE_UNLICENSED_ARG" ] && [ -z "$UPDATE_LICENSES" ]; then
if ! __is_vendor_enabled; then
echo "$SPEC_FILE is not go-vendor-tools enabled"
exit 4
fi
UPDATE_LICENSES=1
fi
if [ -n "$SOURCES_FILE" ] && [ -z "$UPDATE_SOURCES" ]; then
UPDATE_SOURCES=1
fi
# Ensure remote sources are downloaded
spectool -g "$SPEC_FILE"
}
_check_go_vendor_enabled() {
# go2rpm creates a go-vendor-tools.toml file when using the vendor profile
if [[ "$UPDATE_ARCHIVE" -eq 1 || "$UPDATE_LICENSES" -eq 1 ]] && ! grep -q go-vendor-tools.toml "$SPEC_FILE"; then
if [[ "$UPDATE_ARCHIVE" -eq 1 || "$UPDATE_LICENSES" -eq 1 ]] && ! __is_vendor_enabled; then
echo The spec file is not go-vendor-tools enabled
exit 4
exit 14
fi
}
_download_sources() {
if __has_spec_file; then
if ! spectool -g "$SPEC_FILE"; then
echo The spec file $SPEC_FILE is not parsable
exit 96
fi
fi
}
_update_archive() {
if ! __has_spec_file; then
echo ERROR: Variable SPEC_FILE is not set
exit 97
fi
# Update the go vendors archive
if [[ "$UPDATE_ARCHIVE" -eq 1 ]]; then
echo Updating go vendor archive
if ! go_vendor_archive create --config go-vendor-tools.toml --write-config "$SPEC_FILE"; then
echo Archive update failed
exit 5
exit 15
fi
fi
}
@@ -121,32 +174,15 @@ _update_licenses() {
# shellcheck disable=SC2086
if ! go_vendor_license --config go-vendor-tools.toml --path "$SPEC_FILE" report --write-config --prompt --autofill auto --update-spec$IGNORE_UNLICENSED_ARG; then
echo License update failed
exit 6
exit 16
fi
fi
}
# shellcheck disable=SC2046,SC2086
__find_sources() {
if [ "$SOURCES_FILE" != "" ] && [ -d "$(dirname $SOURCES_FILE)" ] && [ "$PWD" != "$(dirname $SOURCES_FILE)" ]; then
DO_POP=1
pushd "$(dirname $SOURCES_FILE)" > /dev/null || exit 98
fi
if [ -d .git ]; then
FILENAMES=$(git ls-files --exclude-standard | grep -v -e '^\.' -e sources)
else
FILENAMES=$(find . -path "./RPMS" -prune -o -path "./BUILD" -prune -o -path "./SRPMS" -prune -o -path "./.*" -prune -o \( ! \( -name '*.spec' -o -name '.*' -o -name sources \) -a -type f \) -printf ' %P')
fi
if [[ "$DO_POP" -eq 1 ]]; then
popd > /dev/null || echo $FILENAMES
fi
echo $FILENAMES
}
_update_sources() {
# Update the sources checksums
if [[ "$UPDATE_SOURCES" -eq 1 ]]; then
if [ "$SOURCES_FILE" != "" ] && [ -d "$(dirname $SOURCES_FILE)" ]; then
if [ -n "$SOURCES_FILE" ] && [ -d "$(dirname $SOURCES_FILE)" ]; then
DO_POP=1
pushd "$(dirname $SOURCES_FILE)" > /dev/null || exit 98
fi
@@ -154,11 +190,14 @@ _update_sources() {
echo Calculating checksums
# shellcheck disable=SC2046
SOURCES="$(__find_sources)"
if [ "$SOURCES" == "" ]; then
if [ -z "$SOURCES" ]; then
echo No relevant sources found. Skipping checksumming.
return 0
fi
cksum -a sha512 $SOURCES > "${SOURCES_FILE:-sources}"
if ! cksum -a sha512 $SOURCES > "${SOURCES_FILE:-sources}"; then
echo Sources checksum calculation failed
exit 17
fi
if [[ "$DO_POP" -eq 1 ]]; then
popd > /dev/null || exit 98
+55 -10
View File
@@ -7,13 +7,16 @@ setup() {
common_setup
}
# bats file_tags=mandatory_spec_file_argument
# bats file_tags=spec_file_argument
@test "Missing spec file argument returns an error" {
run _parse_args
@test "No selection without a spec file selects sources update" {
_parse_args
assert_failure 1
assert_line --index 0 "The required spec parameter is missing"
assert_equal "$?" 0
assert_equal "$UPDATE_ARCHIVE" ""
assert_equal "$UPDATE_LICENSES" ""
assert_equal "$UPDATE_SOURCES" 1
assert_equal "$IGNORE_UNLICENSED_ARG" ""
}
@test "A not .spec file returns an error" {
@@ -32,8 +35,15 @@ setup() {
# bats file_tags=options
@test "No selection selects all actions" {
touch "$TEST_TEMP_DIR/a.spec"
@test "Invalid option returns an error" {
run _parse_args -q a.spec
assert_failure 9
assert_line --index 0 "Option -q is invalid"
}
@test "No selection with a spec file selects all actions" {
echo "Source: go-vendor-tools.toml" > "$TEST_TEMP_DIR/a.spec"
_parse_args "$TEST_TEMP_DIR/a.spec"
assert_equal "$?" 0
@@ -77,7 +87,8 @@ setup() {
}
@test "Multiple selections aggregate" {
touch "$TEST_TEMP_DIR/a.spec"
echo "Source: go-vendor-tools.toml" > "$TEST_TEMP_DIR/a.spec"
_parse_args -s -l "$TEST_TEMP_DIR/a.spec"
assert_equal "$?" 0
@@ -88,7 +99,7 @@ setup() {
}
@test "The -u option configures an --ignore-unlicensed-mods parameter for go_vendor_license" {
touch "$TEST_TEMP_DIR/a.spec"
echo "Source: go-vendor-tools.toml" > "$TEST_TEMP_DIR/a.spec"
_parse_args -u "$TEST_TEMP_DIR/a.spec"
assert_equal "$?" 0
@@ -99,7 +110,8 @@ setup() {
}
@test "The -u option implies -l" {
touch "$TEST_TEMP_DIR/a.spec"
echo "Source: go-vendor-tools.toml" > "$TEST_TEMP_DIR/a.spec"
_parse_args -u -s "$TEST_TEMP_DIR/a.spec"
assert_equal "$?" 0
@@ -109,6 +121,15 @@ setup() {
assert_equal "$UPDATE_SOURCES" 1
}
@test "The -u options returns an error in a not go-vendor-tools enabled project" {
touch "$TEST_TEMP_DIR/a.spec"
run _parse_args -u -s "$TEST_TEMP_DIR/a.spec"
assert_failure 4
assert_output "$TEST_TEMP_DIR/a.spec is not go-vendor-tools enabled"
}
@test "The help option successfully short-circuits everything else" {
touch "$TEST_TEMP_DIR/a.spec"
run _parse_args -h
@@ -116,3 +137,27 @@ setup() {
assert_success
assert_line --index 0 --partial "Usage: "
}
@test "-t sets the sources file path and enables sources re-generation" {
touch "$TEST_TEMP_DIR/a.spec"
_parse_args -t "$TEST_TEMP_DIR/sources" "$TEST_TEMP_DIR/a.spec"
assert_equal "$?" 0
assert_equal "$UPDATE_ARCHIVE" ""
assert_equal "$UPDATE_LICENSES" ""
assert_equal "$SOURCES_FILE" "$TEST_TEMP_DIR/sources"
assert_equal "$UPDATE_SOURCES" 1
}
@test "-t sets the sources file path and adds sources re-generation to pre-existing requests" {
echo "Source: go-vendor-tools.toml" > "$TEST_TEMP_DIR/a.spec"
_parse_args -a -t "$TEST_TEMP_DIR/sources" "$TEST_TEMP_DIR/a.spec"
assert_equal "$?" 0
assert_equal "$UPDATE_ARCHIVE" 1
assert_equal "$UPDATE_LICENSES" ""
assert_equal "$SOURCES_FILE" "$TEST_TEMP_DIR/sources"
assert_equal "$UPDATE_SOURCES" 1
}
+115 -24
View File
@@ -6,11 +6,29 @@ bats_load_library 'bats-mock'
setup() {
load ../spec-update-artifacts.sh
common_setup
echo "" > "$TEST_TEMP_DIR/test.spec"
export SPEC_FILE="$TEST_TEMP_DIR/test.spec"
export SOURCES_FILE="$TEST_TEMP_DIR/sources"
}
_make_valid_spec() {
export SPEC_FILE="$TEST_TEMP_DIR/test.spec"
cat > $SPEC_FILE <<EOL
Name: Gurli
Version: 0
Release: 0
Summary: Test
License: MIT
Source: v1.0.0.tar.gz
Source: vendor.tar.bz2
Source: go-vendor-tools.toml
Source: sources
Source: changelog
Source: README.md
Source: LICENSE
%description
Fnuggi
EOL
}
# bats file_tags=vendor_update_validation
@test "Script returns error when trying to update go vendor archive on a spec that is not go vendor enabled" {
@@ -18,7 +36,7 @@ setup() {
run _check_go_vendor_enabled
assert_failure 4
assert_failure 14
assert_output "The spec file is not go-vendor-tools enabled"
}
@@ -27,7 +45,7 @@ setup() {
run _check_go_vendor_enabled
assert_failure 4
assert_failure 14
assert_output "The spec file is not go-vendor-tools enabled"
}
@@ -43,7 +61,7 @@ setup() {
@test "Script succeeds when a spec is go vendor enabled" {
export UPDATE_LICENSES=1
export UPDATE_SOURCES=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
run _check_go_vendor_enabled
@@ -55,7 +73,7 @@ setup() {
@test "Archive is updated when spec is valid and update is requested" {
export UPDATE_ARCHIVE=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_archive "create --config go-vendor-tools.toml --write-config $TEST_TEMP_DIR/test.spec : echo"
run _update_archive
@@ -68,7 +86,7 @@ setup() {
@test "Archive is only updated when an update is requested" {
export UPDATE_LICENSES=1
export UPDATE_SOURCES=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_archive "create --config go-vendor-tools.toml --write-config $TEST_TEMP_DIR/test.spec : echo"
run _update_archive
@@ -80,14 +98,14 @@ setup() {
"$BATS_MOCK_REAL_rm" -rf "${BATS_MOCK_TMPDIR}" || true
}
@test "Some feedback is proffered when go_vendor_archive fails" {
@test "Sane feedback is proffered when go_vendor_archive fails" {
export UPDATE_ARCHIVE=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_archive "create --config go-vendor-tools.toml --write-config $TEST_TEMP_DIR/test.spec : exit 3"
run _update_archive
assert_failure 5
assert_failure 15
assert_output - <<<"Updating go vendor archive
Archive update failed"
unstub go_vendor_archive
@@ -97,7 +115,7 @@ Archive update failed"
@test "Licenses are updated when spec is valid and update is requested" {
export UPDATE_LICENSES=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_license "--config go-vendor-tools.toml --path $TEST_TEMP_DIR/test.spec report --write-config --prompt --autofill auto --update-spec : echo"
run _update_licenses
@@ -110,7 +128,7 @@ Archive update failed"
@test "Licenses are only updated when an update is requested" {
export UPDATE_ARCHIVE=1
export UPDATE_SOURCES=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_license "--config go-vendor-tools.toml --path $TEST_TEMP_DIR/test.spec report --write-config --prompt --autofill auto --update-spec : echo"
run _update_licenses
@@ -122,14 +140,14 @@ Archive update failed"
"$BATS_MOCK_REAL_rm" -rf "${BATS_MOCK_TMPDIR}" || true
}
@test "Some feedback is proffered when go_vendor_license fails" {
@test "Sane feedback is proffered when go_vendor_license fails" {
export UPDATE_LICENSES=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_license "--config go-vendor-tools.toml --path $TEST_TEMP_DIR/test.spec report --write-config --prompt --autofill auto --update-spec : exit 3"
run _update_licenses
assert_failure 6
assert_failure 16
assert_output - <<<"Updating go vendor licenses
License update failed"
unstub go_vendor_license
@@ -138,7 +156,7 @@ License update failed"
@test "--ignore-unlicensed-mods to the go_vendor_license command from IGNORE_UNLICENSED_ARG" {
export UPDATE_LICENSES=1
export IGNORE_UNLICENSED_ARG=" --ignore-unlicensed-mods"
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
stub go_vendor_license "--config go-vendor-tools.toml --path $TEST_TEMP_DIR/test.spec report --write-config --prompt --autofill auto --update-spec --ignore-unlicensed-mods : echo"
run _update_licenses
@@ -153,20 +171,60 @@ License update failed"
@test "sources is updated when spec is valid and update is requested" {
export UPDATE_SOURCES=1
tar -xzf "$BATS_TEST_DIRNAME/testdata/example.tar.gz" -C "$TEST_TEMP_DIR/"
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
run _update_sources
assert_success
assert_output "Calculating checksums"
assert_file_not_empty "$SOURCES_FILE"
assert_file_contains "$SOURCES_FILE" "SHA512 (v1.0.0.tar.gz)"
assert_file_contains "$SOURCES_FILE" "SHA512 (LICENSE)"
assert_file_contains "$SOURCES_FILE" "SHA512 (README.md)"
assert_file_not_contains "$SOURCES_FILE" sources
assert_file_not_contains "$SOURCES_FILE" test.spec
assert_file_not_contains "$SOURCES_FILE" BUILD
assert_file_not_contains "$SOURCES_FILE" .git
}
@test "sources is updated in a git directory without spec and update is requested" {
export UPDATE_SOURCES=1
tar -xzf "$BATS_TEST_DIRNAME/testdata/git.example.tar.gz" -C "$TEST_TEMP_DIR/"
run _update_sources
assert_success
assert_output "Calculating checksums"
assert_file_contains "$SOURCES_FILE" "SHA512 (v1.0.0.tar.gz)"
assert_file_contains "$SOURCES_FILE" "SHA512 (LICENSE)"
assert_file_contains "$SOURCES_FILE" "SHA512 (README.md)"
assert_file_not_contains "$SOURCES_FILE" sources
assert_file_not_contains "$SOURCES_FILE" BUILD
assert_file_not_contains "$SOURCES_FILE" .git
}
@test "sources is updated in a plain directory when spec is valid and update is requested" {
export UPDATE_SOURCES=1
tar -xzf "$BATS_TEST_DIRNAME/testdata/example.tar.gz" -C "$TEST_TEMP_DIR/"
_make_valid_spec
run _update_sources
assert_success
assert_output "Calculating checksums"
assert_file_contains "$SOURCES_FILE" "SHA512 (v1.0.0.tar.gz)"
assert_file_contains "$SOURCES_FILE" "SHA512 (LICENSE)"
assert_file_contains "$SOURCES_FILE" "SHA512 (README.md)"
assert_file_not_contains "$SOURCES_FILE" sources
assert_file_not_contains "$SOURCES_FILE" test.spec
assert_file_not_contains "$SOURCES_FILE" BUILD
assert_file_not_contains "$SOURCES_FILE" .git
}
@test "sources is only updated when an update is requested" {
export UPDATE_LICENSES=1
export UPDATE_ARCHIVE=1
tar -xzf "$BATS_TEST_DIRNAME/testdata/example.tar.gz" -C "$TEST_TEMP_DIR/"
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
_make_valid_spec
run _update_sources
@@ -176,9 +234,18 @@ License update failed"
}
@test "When there are no relevant sources, checksumming is skipped" {
stub cksum "exit 1"
export UPDATE_SOURCES=1
echo "Source: go-vendor-tools.toml" > $SPEC_FILE
export SPEC_FILE="$TEST_TEMP_DIR/test.spec"
cat > $SPEC_FILE <<EOL
Name: Gurli
Version: 0
Release: 0
Summary: Test
License: MIT
Source: sources
%description
Fnuggi
EOL
run _update_sources
@@ -187,6 +254,20 @@ License update failed"
No relevant sources found. Skipping checksumming."
}
@test "Sane feedback is proffered when cksum fails" {
stub cksum "exit 1"
export UPDATE_SOURCES=1
tar -xzf "$BATS_TEST_DIRNAME/testdata/git.example.tar.gz" -C "$TEST_TEMP_DIR/"
_make_valid_spec
run _update_sources
unstub cksum
assert_failure 17
assert_output - <<<"Calculating checksums
Sources checksum calculation failed"
}
# bats test_tags=find_sources
@test "The list of files to include in sources excludes the correct things in a git repo" {
tar -xzf "$BATS_TEST_DIRNAME/testdata/git.example.tar.gz" -C "$TEST_TEMP_DIR/"
@@ -195,8 +276,6 @@ No relevant sources found. Skipping checksumming."
assert_success
assert_output "LICENSE README.md changelog data/README data/somedata.csv v1.0.0.tar.gz vendor.tar.bz2"
# Some files under .git are read-only
rm -fR "$TEST_TEMP_DIR/.git"
}
# bats test_tags=find_sources
@@ -206,5 +285,17 @@ No relevant sources found. Skipping checksumming."
run __find_sources
assert_success
assert_output "vendor.tar.bz2 v1.0.0.tar.gz README.md LICENSE data/somedata.csv data/README changelog"
assert_output "go-vendor-tools.toml vendor.tar.bz2 v1.0.0.tar.gz README.md LICENSE data/somedata.csv data/README changelog"
}
# bats test_tags=find_sources
@test "If neither git or find are installed and there is no .spec file, you get an error and explanation" {
stub which "return 1" "return 1"
tar -xzf "$BATS_TEST_DIRNAME/testdata/git.example.tar.gz" -C "$TEST_TEMP_DIR/"
run __find_sources
unstub which
assert_failure 97
assert_output "No way to search for relevant source files was found. Please install find (and git if this is a git repository directory) or add a .spec file to the directory."
}
+2 -4
View File
@@ -11,13 +11,11 @@ setup() {
# bats file_tags=download_sources
@test "Missing spec variable exits with status 99" {
@test "Missing spec variable skips action" {
stub spectool ''
run _download_sources
_download_sources
assert_failure 99
assert_output "ERROR: Variable SPEC_FILE in not set"
assert_file_exists ${SPECTOOL_STUB_PLAN}
# unstub fails the test because spectool wasn't invoked
"$BATS_MOCK_REAL_rm" -rf "${BATS_MOCK_TMPDIR}" || true
+4
View File
@@ -8,6 +8,10 @@ setup_file() {
}
teardown() {
if [ -d "$TEST_TEMP_DIR/.git" ]; then
# Some files under .git are read-only
rm -fR "$TEST_TEMP_DIR/.git"
fi
temp_del "$TEST_TEMP_DIR"
unset TEST_TEMP_DIR
}
BIN
View File
Binary file not shown.