Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Commit 38adf88

Browse files
committed
impr: print local repo
1 parent 64dc7bf commit 38adf88

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

cmd/install.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const installHelp = "usage: sqlpkg install [package]"
1111

1212
// InstallAll installs all packages from the lockfile.
1313
func InstallAll(args []string) error {
14+
printLocalRepo()
15+
1416
lck, err := readLockfile()
1517
if err != nil {
1618
return err
@@ -49,6 +51,8 @@ func Install(args []string) error {
4951
return errors.New(installHelp)
5052
}
5153

54+
printLocalRepo()
55+
5256
path := args[0]
5357
err := installPackage(path)
5458
return err

cmd/list.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ func sortPackages(packages []*spec.Package) {
9191

9292
// printPackages prints packages.
9393
func printPackages(packages []*spec.Package) {
94-
if workDir == "." {
95-
log("(local repository)")
96-
}
94+
printLocalRepo()
9795
if len(packages) == 0 {
9896
log("no packages installed")
9997
return
@@ -106,3 +104,9 @@ func printPackages(packages []*spec.Package) {
106104
fmt.Fprintln(w, pkg.FullName(), "\t", pkg.Description)
107105
}
108106
}
107+
108+
func printLocalRepo() {
109+
if workDir == "." {
110+
log("(local repository)")
111+
}
112+
}

cmd/uninstall.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ func Uninstall(args []string) error {
1212
return errors.New(uninstallHelp)
1313
}
1414

15+
printLocalRepo()
16+
1517
fullName := args[0]
1618
log("> uninstalling %s...", fullName)
1719

cmd/update.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ func UpdateAll(args []string) error {
1717
return errors.New(updateHelp)
1818
}
1919

20+
printLocalRepo()
21+
2022
pattern := fmt.Sprintf("%s/%s/*/*/%s", workDir, spec.DirName, spec.FileName)
2123
paths, _ := filepath.Glob(pattern)
2224

0 commit comments

Comments
 (0)