Skip to content

Conversation

suzuki-shunsuke
Copy link
Member

@suzuki-shunsuke suzuki-shunsuke commented Feb 11, 2025

This pull request adds a field import_dir to aqua.yaml, and it also adds command line options -u and -i to aqua init command.

e.g. aqua.yaml

registries:
- type: standard
  ref: v4.311.0
import_dir: imports
aqua init -u # Create aqua.yaml with `import_dir: imports`
aqua init -i pkgs # Create aqua.yaml with `import_dir: pkgs`

You can use import_dir and packages at the same time.
In addition to packages, aqua searches packages from the directory specified with import_dir.

import_dir: imports is equivalent to the following settings.

packages:
- import: imports/*.yml
- import: imports/*.yaml

And if import_dir is set, aqua g -i command creates a directory <import_dir> and adds packages to the file <import_dir>/<command name>.yaml.
For instance, if import_dir is imports, aqua g -i cli/cli creates a directory imports and adds cli/cli to imports/gh.yaml.

If the package has multiple commands, <command name> is the first command name in the files setting.
For instance, in case of FiloSottile/age, <command name> is age.

https://github.com/aquaproj/aqua-registry/blob/d39d4b5d0fb0635f6be7a70f3cb8b994f075a639/pkgs/FiloSottile/age/registry.yaml#L13-L17

    files:
      - name: age
        src: age/age
      - name: age-keygen
        src: age/age-keygen

@suzuki-shunsuke suzuki-shunsuke marked this pull request as ready for review February 12, 2025 08:05
@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Feb 12, 2025
@suzuki-shunsuke suzuki-shunsuke added this to the v2.44.0 milestone Feb 12, 2025
@suzuki-shunsuke suzuki-shunsuke merged commit faa099e into main Feb 12, 2025
15 checks passed
@suzuki-shunsuke suzuki-shunsuke deleted the feat-import-dir branch February 12, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant