Skip to content

Commit 3333aa7

Browse files
committed
Rename 'bundle' to 'archive' per feedback from Ed
1 parent 335c6b9 commit 3333aa7

File tree

1 file changed

+14
-14
lines changed
  • internal/engine/eval/rego

1 file changed

+14
-14
lines changed

internal/engine/eval/rego/lib.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var MinderRegoLib = []func(res *interfaces.Result) func(*rego.Rego){
3838
FileHTTPType,
3939
FileRead,
4040
FileWalk,
41-
FileBundle,
41+
FileArchive,
4242
ListGithubActions,
4343
BaseFileExists,
4444
BaseFileLs,
@@ -47,7 +47,7 @@ var MinderRegoLib = []func(res *interfaces.Result) func(*rego.Rego){
4747
BaseFileRead,
4848
BaseFileWalk,
4949
BaseListGithubActions,
50-
BaseFileBundle,
50+
BaseFileArchive,
5151
ParseYaml,
5252
JQIsTrue,
5353
}
@@ -428,44 +428,44 @@ func fileLsHandleDir(path string, bfs billy.Filesystem) (*ast.Term, error) {
428428
ast.NewArray(files...)), nil
429429
}
430430

431-
// FileBundle packages a set of files form the the specified directory into
431+
// FileArchive packages a set of files form the the specified directory into
432432
// a tarball. It takes one argument: a list of file or directory paths to
433433
// include, and outputs the tarball as a string.
434-
// It's exposed as 'file.bundle`.
435-
func FileBundle(res *interfaces.Result) func(*rego.Rego) {
434+
// It's exposed as 'file.archive`.
435+
func FileArchive(res *interfaces.Result) func(*rego.Rego) {
436436
return rego.Function1(
437437
&rego.Function{
438-
Name: "file.bundle",
438+
Name: "file.archive",
439439
Decl: types.NewFunction(types.Args(types.NewArray(nil, types.S)), types.S),
440440
},
441-
fsBundle(res.Fs),
441+
fsArchive(res.Fs),
442442
)
443443
}
444444

445-
// BaseFileBundle packages a set of files form the the specified directory
445+
// BaseFileArchive packages a set of files form the the specified directory
446446
// in the base filesystem (from a pull_request or other diff context) into
447447
// a tarball. It takes one argument: a list of file or directory paths to
448448
// include, and outputs the tarball as a string.
449-
// It's exposed as 'base_file.bundle`.
450-
func BaseFileBundle(res *interfaces.Result) func(*rego.Rego) {
449+
// It's exposed as 'base_file.archive`.
450+
func BaseFileArchive(res *interfaces.Result) func(*rego.Rego) {
451451
return rego.Function1(
452452
&rego.Function{
453-
Name: "base_file.bundle",
453+
Name: "base_file.archive",
454454
Decl: types.NewFunction(types.Args(types.NewArray(nil, types.S)), types.S),
455455
},
456-
fsBundle(res.BaseFs),
456+
fsArchive(res.BaseFs),
457457
)
458458
}
459459

460-
func fsBundle(vfs billy.Filesystem) func(rego.BuiltinContext, *ast.Term) (*ast.Term, error) {
460+
func fsArchive(vfs billy.Filesystem) func(rego.BuiltinContext, *ast.Term) (*ast.Term, error) {
461461
return func(_ rego.BuiltinContext, op1 *ast.Term) (*ast.Term, error) {
462462
var paths []string
463463
if err := ast.As(op1.Value, &paths); err != nil {
464464
return nil, err
465465
}
466466

467467
if vfs == nil {
468-
return nil, fmt.Errorf("cannot bundle files without a filesystem")
468+
return nil, fmt.Errorf("cannot archive files without a filesystem")
469469
}
470470

471471
out := bytes.Buffer{}

0 commit comments

Comments
 (0)