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 storage dir for modctl #38

Merged
merged 1 commit into from
Dec 9, 2024
Merged

feat: add storage dir for modctl #38

merged 1 commit into from
Dec 9, 2024

Conversation

gaius-qi
Copy link
Contributor

@gaius-qi gaius-qi commented Dec 9, 2024

This pull request includes several changes to the modctl command-line tool, primarily focusing on configuring and using a storage directory specified by the user. The most important changes include modifying backend initialization to accept a storage directory, updating command files to pass the storage directory, and adding a new configuration package to manage the root configuration.

Backend initialization:

Command file updates:

  • cmd/build.go, cmd/extract.go, cmd/inspect.go, cmd/list.go, cmd/login.go, cmd/logout.go, cmd/prune.go, cmd/pull.go, cmd/push.go, cmd/rm.go: Updated the backend initialization to pass rootConfig.StoargeDir as the storage directory. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Configuration management:

  • cmd/root.go: Introduced a new rootConfig variable and initialized it with the NewRoot function from the new config package. Added a persistent flag for specifying the storage directory. [1] [2]
  • pkg/config/root.go: Added a new config package with a Root struct to manage the storage directory configuration.

Unverified

This user has not yet uploaded their public signing key.
Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added the enhancement New feature or request label Dec 9, 2024
@gaius-qi gaius-qi self-assigned this Dec 9, 2024
Copy link
Contributor

@chlins chlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gaius-qi gaius-qi merged commit 8eb6a1f into main Dec 9, 2024
4 checks passed
@gaius-qi gaius-qi deleted the feature/storage-dir branch December 9, 2024 04:11
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

2 participants