Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

feat(zsh-plugins): add feature that installs zsh plugins #198

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

gund
Copy link
Contributor

@gund gund commented Dec 11, 2022

Hi, I would like to contribute a feature that I've recently built for my own dev container setup that allows to install (Oh-My-)ZSH plugins from configuration.

Here's the example of how it's intended to be used:

{
  "features": {
    "ghcr.io/devcontainers/features/common-utils:1": {},
    "./zsh-plugins": {
      "plugins": "npm zsh-autosuggestions", // <-- zsh plugins go here
      "omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions" // <-- oh-my-zsh plugin git urls go here
    }
  }
}

I was trying to follow your contributing guide but it seems outdated as it says to run script from scripts/ folder to generate a feature but there is no such folder anymore.
So I basically created a feature manually and added a test file which for now does not really test the plugin and I need help with it.
Basically I need a way to configure a feature inside a test to set some zsh plugins to be able to assert that they were installed.
Could you please help me how this may be achieved?

Off-topic: I have 2 more generic features that I would like to contribute: one for persisting bash/zsh history in volume so that container rebuilds won't loose commands history and the second feature for persisting vscode extensions folder to allow for faster startup times after container is rebuilt, so would it be fine to contribute them here as well?

Thanks!

@gund
Copy link
Contributor Author

gund commented Dec 11, 2022

Oh I just discovered from another PR here that scenarios is probably what I need to use for my feature testing to setup zsh plugins?

@gund
Copy link
Contributor Author

gund commented Dec 12, 2022

So I've tried to add a scenario to test the feature but unfortunately it fails to picking zsh plugins in the tests, so I'm not quite sure what I'm doing wrong in the tests but I'm trying to execute tests under zsh -c "cmd" which should have the plugins configured but they are not there for some reason.

Any clues what may be the problem?

@gund
Copy link
Contributor Author

gund commented Dec 12, 2022

Nevermind, I've fixed all tests and they are now passing.

Waiting for your feedback now.

@gund gund marked this pull request as ready for review December 12, 2022 23:22
@danielbraun89
Copy link
Member

Looks good to me, Altho there are some voices for comma-separated values instead of spaces (devcontainers/spec#57 (comment)) I would say thats a more of a matter of preference, lets get it merged!

@danielbraun89 danielbraun89 merged commit 0df79f9 into devcontainers-contrib:main Dec 13, 2022
@gund gund deleted the feat-zsh-plugins branch December 14, 2022 00:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants