added protection against trailing slash

This commit is contained in:
Todd Gruben 2021-11-15 10:54:13 -06:00
parent 5a68470339
commit 7de69df424
2 changed files with 5 additions and 1 deletions

View file

@ -243,6 +243,9 @@ func copyFile(src, dest string) error {
}
func Migrate(dataDir, backupPath string) error {
if strings.HasSuffix(dataDir, "/") {
dataDir = dataDir[:len(dataDir)-1]
}
err := os.MkdirAll(backupPath, 0777)
if err != nil {
return err

View file

@ -2,7 +2,8 @@
# actually get test coverage for every single package and subpackage
# very slow but oh well what are you gonna do, not test things?
# note it skips the roaring migrate
echo "mode: atomic" > coverage.out
for pkg in $(go list all | grep featurebase); do
for pkg in $(go list all | grep featurebase | grep -v roaring-migrate); do
go test -coverprofile=pkgcoverage.out -covermode=atomic $pkg;
tail -n +2 pkgcoverage.out >> coverage.out; done