feat: add --from flag, refactor source providers (#2610)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Keith Zantow
2024-02-27 16:44:37 -05:00
committed by GitHub
parent 928511ea0f
commit a978966cad
72 changed files with 1035 additions and 1080 deletions
+26
View File
@@ -0,0 +1,26 @@
package testutil
import (
"os"
"testing"
"github.com/stretchr/testify/require"
)
func Chdir(t *testing.T, dir string) {
t.Helper()
wd, err := os.Getwd()
if err != nil {
t.Fatalf("unable to get working directory: %v", err)
}
err = os.Chdir(dir)
if err != nil {
t.Fatalf("unable to chdir to '%s': %v", dir, err)
}
t.Cleanup(func() {
require.NoError(t, os.Chdir(wd))
})
}