Skip to content

Commit 399c92d

Browse files
committed
♻️ Synced dbin 📦 <-- misc/cmd/goScrap: Sprinkle items with .Description and other data ⌚
1 parent d816770 commit 399c92d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

misc/cmd/goScrap/goScrap.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ func main() {
7171
Usage: "Detects Go CLI programs and generates appropriate go build or install commands",
7272
Flags: []cli.Flag{
7373
&cli.BoolFlag{
74-
Name: "verbose",
75-
Usage: "Enable verbose output to stderr",
74+
Name: "verbose",
75+
Usage: "Enable verbose output to stderr",
76+
Aliases: []string{"v"},
7677
},
7778
},
7879
Commands: []*cli.Command{
@@ -129,11 +130,6 @@ func main() {
129130
Usage: "Specify output file for metadata (default: metadata.json in input dir)",
130131
Value: "",
131132
},
132-
&cli.BoolFlag{
133-
Name: "verbose",
134-
Usage: "Enable verbose output to stderr",
135-
Value: false,
136-
},
137133
},
138134
Action: metagenAction,
139135
},
@@ -213,6 +209,13 @@ func metagenAction(ctx context.Context, c *cli.Command) error {
213209
return nil
214210
}
215211

212+
err = client.Sprinkle(pkgInfo)
213+
if err != nil {
214+
if verbose {
215+
fmt.Fprintf(os.Stderr, "Warning: could not sprinkle bare package info with git repo info: %s: %v\n", buildInfo.Path, err)
216+
}
217+
}
218+
216219
size := fmt.Sprintf("%d", info.Size())
217220

218221
buildDate := ""
@@ -316,7 +319,7 @@ func detectAction(ctx context.Context, c *cli.Command) error {
316319
}
317320

318321
if len(result.Directories) == 0 {
319-
return fmt.Errorf("no valid Go CLI programs found in %s", absRootDir)
322+
return fmt.Errorf("no valid Go programs found in %s", absRootDir)
320323
}
321324

322325
if useJSON {
@@ -367,7 +370,7 @@ func installAction(ctx context.Context, c *cli.Command) error {
367370
}
368371

369372
if len(result.Directories) == 0 {
370-
return fmt.Errorf("no valid Go CLI programs found in %s", absRootDir)
373+
return fmt.Errorf("no valid Go programs found in %s", absRootDir)
371374
}
372375

373376
goModPath, err := findGoModPath(absRootDir)

0 commit comments

Comments
 (0)