| 207 | } |
| 208 | |
| 209 | func (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 |