rossmacarthur/sheldon

Rename remote file

ThibaultNocchi opened this issue · 2 comments

Hello, thanks for your tool!

I'm downloading a ZSH completion file with the remote plugin, but it seems to need to be renamed to be applied by OMZ.

Is it possible to do this?

Thanks!

You can apply an arbitrary template to symlink the downloaded file to a folder that Oh My Zsh will load the completion from. For example assuming $ZSH is your Oh My Zsh installation and $ZSH/completions exists:

[templates]
symlink = { value = 'ln -s "{{ file }}" "$ZSH/completions/_{{ name }}"', each = true }

[plugins.myplugin]
remote = "https://myplugin.example.com/file"
apply = ["symlink"]

Thanks, in the end I did this:

[templates]
completion = { value = 'mkdir -p "$ZSH/completions"; ln -s "{{ file }}" "$ZSH/completions/_{{ name }}"', each = true }

Though I think it'd be cool to be able to do something like this:

[plugins.pass]
remote = 'https://git.zx2c4.com/password-store/plain/src/completion/pass.zsh-completion'
name = "_pass"
apply = ["fpath"]

Or I could just link to the file in the same dir with a template, but I didn't find how.

Thanks!