@@ -38,7 +38,7 @@ var MinderRegoLib = []func(res *interfaces.Result) func(*rego.Rego){
38
38
FileHTTPType ,
39
39
FileRead ,
40
40
FileWalk ,
41
- FileBundle ,
41
+ FileArchive ,
42
42
ListGithubActions ,
43
43
BaseFileExists ,
44
44
BaseFileLs ,
@@ -47,7 +47,7 @@ var MinderRegoLib = []func(res *interfaces.Result) func(*rego.Rego){
47
47
BaseFileRead ,
48
48
BaseFileWalk ,
49
49
BaseListGithubActions ,
50
- BaseFileBundle ,
50
+ BaseFileArchive ,
51
51
ParseYaml ,
52
52
JQIsTrue ,
53
53
}
@@ -428,44 +428,44 @@ func fileLsHandleDir(path string, bfs billy.Filesystem) (*ast.Term, error) {
428
428
ast .NewArray (files ... )), nil
429
429
}
430
430
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
432
432
// a tarball. It takes one argument: a list of file or directory paths to
433
433
// 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 ) {
436
436
return rego .Function1 (
437
437
& rego.Function {
438
- Name : "file.bundle " ,
438
+ Name : "file.archive " ,
439
439
Decl : types .NewFunction (types .Args (types .NewArray (nil , types .S )), types .S ),
440
440
},
441
- fsBundle (res .Fs ),
441
+ fsArchive (res .Fs ),
442
442
)
443
443
}
444
444
445
- // BaseFileBundle packages a set of files form the the specified directory
445
+ // BaseFileArchive packages a set of files form the the specified directory
446
446
// in the base filesystem (from a pull_request or other diff context) into
447
447
// a tarball. It takes one argument: a list of file or directory paths to
448
448
// 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 ) {
451
451
return rego .Function1 (
452
452
& rego.Function {
453
- Name : "base_file.bundle " ,
453
+ Name : "base_file.archive " ,
454
454
Decl : types .NewFunction (types .Args (types .NewArray (nil , types .S )), types .S ),
455
455
},
456
- fsBundle (res .BaseFs ),
456
+ fsArchive (res .BaseFs ),
457
457
)
458
458
}
459
459
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 ) {
461
461
return func (_ rego.BuiltinContext , op1 * ast.Term ) (* ast.Term , error ) {
462
462
var paths []string
463
463
if err := ast .As (op1 .Value , & paths ); err != nil {
464
464
return nil , err
465
465
}
466
466
467
467
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" )
469
469
}
470
470
471
471
out := bytes.Buffer {}
0 commit comments