1

I'm trying to automate installing a ZSH plugin depending on which configuration framework the user is running (For example - prezto or oh-my-zsh) since the install location of the plugin changes with the change in config framework.

For example, for oh-my-zsh the plugins must be installed in ~/.oh-my-zsh/custom/plugins folder whereas in prezto they must be installed in the ~/.prezto/modules folder.

Is there a way I could determine the configuration framework or a workaround to install the plugin in both these cases? Thanks in advance.

Rohan Lekhwani
  • 470
  • 4
  • 14

1 Answers1

1

Regardless of the framework in use, the location of the plugins is configurable by the user, so detecting a framework only lets you predict the default location of the plugin directory, not the directory actually in use.

Just use an environment variable like PLUGINDIR in your installer, and let the user be responsible for setting its value to ~/.oh-my-zsh/custom/plugins or ~/.prezto/modules or ~/.config/zsh/oh-my-zsh-plugs, etc., as appropriate.

chepner
  • 497,756
  • 71
  • 530
  • 681