| 1234567891011121314151617181920212223242526272829 |
- package preprocessor
- import (
- "fmt"
- cbchelper "git.buran.team/main/cbc/helper"
- cbcscheme "git.buran.team/main/cbc/scheme"
- )
- type GoModVendorPreprocessor struct {
- }
- func NewGoModVendorPreprocessor(preprocessorScheme cbcscheme.TaskPreprocessor) (*GoModVendorPreprocessor, error) {
- return &GoModVendorPreprocessor{}, nil
- }
- func (this *GoModVendorPreprocessor) Process(path string) ([]byte, []byte, error) {
- stdout, stderr, err := cbchelper.Execute(
- fmt.Sprintf(
- "go -C %s mod vendor",
- path,
- ),
- )
- if err != nil {
- return nil, nil, fmt.Errorf("can't go mod vendor over program: %w", err)
- }
- return stdout, stderr, nil
- }
|