Repository navigation
Add Berkshelf commands #32
Description
Version: git-pkgs/managers current main at 241e284.
Trying to build Chef cookbook dependency commands after registering the embedded definitions currently returns unknown manager: berks:
_, err := tr.BuildCommand("berks", "install", managers.CommandInput{})Add a berks definition for Berkshelf. Detect Berksfile.lock as the lockfile and Berksfile as the manifest. Include definitions/berks.yaml, captured version and command help under references/berks, translator tests, and suitable version coverage as described in the new manager contribution guide.
The upstream CLI provides the needed command mappings:
berks installinstalls the Berksfile dependencies, whileberks update [COOKBOOKS]updates all or selected locked cookbooks. Both accept--berksfile PATH.berks listandberks outdated [COOKBOOKS]also accept a custom Berksfile and group filters. The command definitions document those arguments.- Use
berks list --format jsonforresolve. It returns the resolved cookbook set and versions, but it does not include dependency edges. The JSON formatter also supports machine-readableoutdatedandlistoutput. - Map
vendortoberks vendor [PATH], including--deleteand--berksfile. Berkshelf defaults the destination toberks-cookbooks; its vendor command accepts a custom directory.
Berkshelf has no frozen-install CLI flag. A trusted Berksfile.lock is used automatically during install; an untrusted lockfile can be resolved and rewritten. Add install, but do not declare install_frozen unless separate enforcement is added and tested. "Frozen" options elsewhere in the CLI apply to cookbook uploads, not dependency installation.
The upstream repository includes a small Berksfile example and its Berksfile.lock. Use equivalent local fixtures for detection and command tests.
Tests should cover default and custom Berksfile paths, install with and without a lockfile, JSON list and outdated output, all-cookbook and single-cookbook updates, and vendor's default path, custom path, and --delete flag. Include capability tests for install, list, outdated, update, resolve, vendor, and json_output, and prove that install_frozen is not declared.
Activity