2
0
Fork 0
mirror of https://github.com/bazel-contrib/bazel-lib synced 2024-11-26 13:30:30 +00:00

chore: bazel run //:buildifier (#903)

This commit is contained in:
Greg Magolan 2024-08-14 11:27:58 -07:00 committed by GitHub
parent 385717a2a5
commit a36dd1201a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 21 deletions

View file

@ -116,11 +116,11 @@ copy_directory(
sh_test(
name = "test_preserve_mtime",
size = "small",
srcs = ["test_preserve_mtime.sh"],
data = [
"d",
":copy_to_directory_mtime_case",
":copy_directory_mtime_case",
":copy_to_directory_mtime_case",
],
size = "small",
)

View file

@ -3,28 +3,28 @@
set -euo pipefail
function main {
compareMTimes d/1 copy_to_directory_mtime_out/d/1
compareMTimes d/1 copy_directory_mtime_out/1
compareMTimes d/1 copy_to_directory_mtime_out/d/1
compareMTimes d/1 copy_directory_mtime_out/1
}
function compareMTimes {
local originalFile="$1"
local copiedFile="$2"
local originalFile="$1"
local copiedFile="$2"
local mtimeOriginal
mtimeOriginal="$(stat --dereference --format=%y "$originalFile")"
local mtimeOriginal
mtimeOriginal="$(stat --dereference --format=%y "$originalFile")"
local mtimeCopy
mtimeCopy="$(stat --dereference --format=%y "$copiedFile")"
local mtimeCopy
mtimeCopy="$(stat --dereference --format=%y "$copiedFile")"
if [[ "$mtimeOriginal" != "$mtimeCopy" ]]; then
echo "Preserve mtime test failed. Modify times do not match for $originalFile and $copiedFile"
echo " Original modify time: $mtimeOriginal"
echo " Copied modify time: $mtimeCopy"
return 1
fi
if [[ "$mtimeOriginal" != "$mtimeCopy" ]]; then
echo "Preserve mtime test failed. Modify times do not match for $originalFile and $copiedFile"
echo " Original modify time: $mtimeOriginal"
echo " Copied modify time: $mtimeCopy"
return 1
fi
echo "Preserve mtime test passed for $originalFile and $copiedFile"
echo "Preserve mtime test passed for $originalFile and $copiedFile"
}
main "$@"

View file

@ -106,10 +106,10 @@ func (w *CopyWorker) Run(wg *sync.WaitGroup) {
}
type CopyOpts struct {
src, dst string
srcInfo fs.FileInfo
hardlink bool
verbose bool
src, dst string
srcInfo fs.FileInfo
hardlink bool
verbose bool
preserveMTime bool
}