Skip to content

🍀 Proposal: Specify the Plugin Directory Through the Configuration file #997

Closed

Description

@daniel-hutao

What Would You Like to Add? Why Is This Needed?

We have a -d flag to specify the plugin directory, and the default value is .devstream. I believe this flag doesn't play a value and almost everyone is using its default behavior.

I believe that using dtm in different directories is a very generic requirement, for example, if today I finish init in /tmp and tomorrow I run dtm again under /root, I want dtm to find the plugins I downloaded yesterday, not every time I tell dtm where the plugins are, or I can only run dtm in a specific directory.

Design

  1. delete -d flag;
  2. add pluginDir in core config. e.g.
# core config
varFile: "" # If not empty, use the specified external variables config file
toolFile: "" # If not empty, use the specified external tools config file
pluginDir: "" If empty, use the "/usr/local/devstream/plugin" directory as default
state: # state config, backend can be local or s3
  backend: local
  options:
    stateFile: devstream.state

Anything else

Done-Done Check

  • All related documents and yaml files have been updated
  • Feature has been implemented
  • Feature has been tested and works properly

Activity

  1. iyear commented on Aug 17, 2022

    @iyear
    Member

    @daniel-hutao Some details need to be discussed

    1. only absolute paths are allowed? If relative paths can be used, there is no effect.
    2. would it be better to set the default path to ~/.devstream? If other systems may be supported in the future, HOME is a more generic path. (https://github.com/mitchellh/go-homedir)
    3. should -d be kept if I have the need to specify the plugin directory temporarily?
  2. daniel-hutao commented on Aug 17, 2022

    @daniel-hutao
    MemberAuthor

    @daniel-hutao Some details need to be discussed

    1. only absolute paths are allowed? If relative paths can be used, there is no effect.
    2. would it be better to set the default path to ~/.devstream? If other systems may be supported in the future, HOME is a more generic path. (https://github.com/mitchellh/go-homedir)
    3. should -d be kept if I have the need to specify the plugin directory temporarily?

    Very good thinking! lgtm for all above. @iyear

  3. iyear commented on Aug 18, 2022

    @iyear
    Member

    @daniel-hutao Perhaps an easier way is to change the default plugin path .devstream directly to ~/.devstream/plugins

    This way the configmanager and documentation doesn't have to be changed.

    const DefaultPluginDir = ".devstream"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions