Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: add installing utility log (#4073)

Tianzhou (天舟)8cfbceddd3c3
diff --git a/resources/mongoutil/mongoutil.go b/resources/mongoutil/mongoutil.go
index 14aa5e6d24..a3f19da447 100644
--- a/resources/mongoutil/mongoutil.go
+++ b/resources/mongoutil/mongoutil.go
@@ -10,6 +10,7 @@ import (
"github.com/pkg/errors"
+ "github.com/bytebase/bytebase/common/log"
"github.com/bytebase/bytebase/resources/utils"
)
@@ -42,18 +43,19 @@ func Install(resourceDir string) (string, error) {
return "", errors.Wrap(err, "failed to get tarball name and version")
}
- mysqlutilDir := path.Join(resourceDir, version)
- if _, err := os.Stat(mysqlutilDir); err != nil {
+ mongoutilDir := path.Join(resourceDir, version)
+ if _, err := os.Stat(mongoutilDir); err != nil {
if !os.IsNotExist(err) {
- return "", errors.Wrapf(err, "failed to check binary directory path %q", mysqlutilDir)
+ return "", errors.Wrapf(err, "failed to check binary directory path %q", mongoutilDir)
}
// Install if not exist yet
- if err := installImpl(resourceDir, mysqlutilDir, tarName, version); err != nil {
+ log.Info("Installing MongoDB utilities...")
+ if err := installImpl(resourceDir, mongoutilDir, tarName, version); err != nil {
return "", errors.Wrap(err, "cannot install mongoutil")
}
}
- return path.Join(mysqlutilDir, "bin"), nil
+ return path.Join(mongoutilDir, "bin"), nil
}
// installImpl installs mongoutil in resourceDir.
diff --git a/resources/mysqlutil/mysqlutil.go b/resources/mysqlutil/mysqlutil.go
index e21bf2730c..e167eb79cd 100644
--- a/resources/mysqlutil/mysqlutil.go
+++ b/resources/mysqlutil/mysqlutil.go
@@ -13,6 +13,7 @@ import (
"github.com/pkg/errors"
+ "github.com/bytebase/bytebase/common/log"
"github.com/bytebase/bytebase/resources/utils"
)
@@ -92,6 +93,7 @@ func Install(resourceDir string) (string, error) {
return "", errors.Wrapf(err, "failed to check binary directory path %q", mysqlutilDir)
}
// Install if not exist yet
+ log.Info("Installing MySQL utilities...")
if err := installImpl(resourceDir, mysqlutilDir, tarName, version); err != nil {
return "", errors.Wrap(err, "cannot install mysqlutil")
}
diff --git a/resources/postgres/postgres.go b/resources/postgres/postgres.go
index 97305014b0..adc68a2744 100644
--- a/resources/postgres/postgres.go
+++ b/resources/postgres/postgres.go
@@ -79,6 +79,7 @@ func Install(resourceDir string) (string, error) {
}
}
if needInstall {
+ log.Info("Installing PostgreSQL utilities...")
// The ordering below made Postgres installation atomic.
tmpDir := path.Join(resourceDir, fmt.Sprintf("tmp-%s", version))
if err := installInDir(tarName, tmpDir); err != nil {