MCPcopy Index your code
hub / github.com/jetify-com/devbox / printPostAddMessage

Method printPostAddMessage

internal/devbox/packages.go:209–237  ·  view source on GitHub ↗
(
	ctx context.Context,
	pkgs []*devpkg.Package,
	unchangedPackageNames []string,
	opts devopt.AddOpts,
)

Source from the content-addressed store, hash-verified

207}
208
209func (d *Devbox) printPostAddMessage(
210 ctx context.Context,
211 pkgs []*devpkg.Package,
212 unchangedPackageNames []string,
213 opts devopt.AddOpts,
214) error {
215 for _, input := range pkgs {
216 if readme, err := plugin.Readme(
217 ctx,
218 input,
219 d.projectDir,
220 false /*markdown*/); err != nil {
221 return err
222 } else if readme != "" {
223 fmt.Fprintf(d.stderr, "%s\n", readme)
224 }
225 }
226
227 if len(opts.Platforms) == 0 && len(opts.ExcludePlatforms) == 0 && len(opts.Outputs) == 0 && len(opts.AllowInsecure) == 0 {
228 if len(unchangedPackageNames) == 1 {
229 ux.Finfof(d.stderr, "Package %q was already in devbox.json and was not modified\n", unchangedPackageNames[0])
230 } else if len(unchangedPackageNames) > 1 {
231 ux.Finfof(d.stderr, "Packages %s were already in devbox.json and were not modified\n",
232 strings.Join(unchangedPackageNames, ", "),
233 )
234 }
235 }
236 return nil
237}
238
239// Remove removes the `pkgs` from the config (i.e. devbox.json) and nix profile
240// for this devbox project

Callers 1

AddMethod · 0.95

Calls 2

ReadmeFunction · 0.92
FinfofFunction · 0.92

Tested by

no test coverage detected