refactor: use _mtree_line helper (#612)

Also restore the .bazeliskrc file I accidentally removed in 4bfe55711a
This commit is contained in:
Alex Eagle 2023-10-10 12:33:21 -07:00 committed by GitHub
parent 20f1ac39e0
commit 177b883991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

2
.bazeliskrc Normal file
View File

@ -0,0 +1,2 @@
BAZELISK_BASE_URL=https://github.com/aspect-build/aspect-cli/releases/download
USE_BAZEL_VERSION=aspect/5.7.2

View File

@ -154,10 +154,7 @@ def _mtree_impl(ctx):
runfiles_dir = _calculate_runfiles_dir(default_info) runfiles_dir = _calculate_runfiles_dir(default_info)
for file in depset(transitive = [s.default_runfiles.files]).to_list(): for file in depset(transitive = [s.default_runfiles.files]).to_list():
destination = _runfile_path(ctx, file, runfiles_dir) destination = _runfile_path(ctx, file, runfiles_dir)
content.add("{} uid=0 gid=0 mode=0755 time=1672560000 type=file content={}".format( content.add(_mtree_line(destination, file.path, "file"))
destination,
file.path,
))
ctx.actions.write(out, content = content) ctx.actions.write(out, content = content)