Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add aqua generate's -i option #575

Merged
merged 9 commits into from
Feb 23, 2022
Merged

feat: add aqua generate's -i option #575

merged 9 commits into from
Feb 23, 2022

Conversation

suzuki-shunsuke
Copy link
Member

@suzuki-shunsuke suzuki-shunsuke commented Feb 23, 2022

Feature

Add aqua generate's -i option.

$ aqua g -i

When this option is set, the search result is added to the configuration file aqua.yaml instead of outputting to standard input.

e.g.

$ cat aqua.yaml
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
registries:
- type: standard
  ref: v1.3.0 # renovate: depName=aquaproj/aqua-registry

packages:
- name: suzuki-shunsuke/cmdx@v1.6.1
- name: golangci/golangci-lint@v1.43.0
- name: rhysd/actionlint@v1.6.8
- import: aqua/*.yaml

$ aqua g -i suzuki-shunsuke/tfcmt
$ cat aqua.yaml                         
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
registries:
- type: standard
  ref: v1.4.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: suzuki-shunsuke/cmdx@v1.6.1
- name: golangci/golangci-lint@v1.43.0
- name: rhysd/actionlint@v1.6.8
- import: aqua/*.yaml
- name: suzuki-shunsuke/tfcmt@v3.0.1
$ git diff aqua.yaml 
diff --git a/aqua.yaml b/aqua.yaml
index 2e42e6a..790ac5e 100644
--- a/aqua.yaml
+++ b/aqua.yaml
@@ -4,9 +4,9 @@
 registries:
 - type: standard
   ref: v1.4.0 # renovate: depName=aquaproj/aqua-registry
-
 packages:
 - name: suzuki-shunsuke/cmdx@v1.6.1
 - name: golangci/golangci-lint@v1.43.0
 - name: rhysd/actionlint@v1.6.8
 - import: aqua/*.yaml
+- name: suzuki-shunsuke/tfcmt@v3.0.1

⚠️ Known Issue

Unfortunately, when configuration file is updated with -i option, comments and indents in YAML are kept but new lines in YAML are removed.
Please see the above diff.
Please fix the issue if you can!

Others

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Feb 23, 2022
@suzuki-shunsuke suzuki-shunsuke added this to the v1.1.0 milestone Feb 23, 2022
@suzuki-shunsuke suzuki-shunsuke merged commit d75f6e7 into main Feb 23, 2022
@suzuki-shunsuke suzuki-shunsuke deleted the feat/add-g-i branch February 23, 2022 07:37
suzuki-shunsuke added a commit that referenced this pull request Feb 23, 2022
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.

None yet

1 participant