GithubHelp home page GithubHelp logo

Comments (4)

mattmc3 avatar mattmc3 commented on May 18, 2024

Interesting. This is the relevant code block:

if [[ ! -e $initfile ]]; then
initfiles=($plugin_dir/*.plugin.{z,}sh(N) $plugin_dir/*.{z,}sh{-theme,}(N))
[[ ${#initfiles[@]} -gt 0 ]] || { echo >&2 "Plugin has no init file '$repo'." && continue }
ln -s "${initfiles[1]}" "$initfile"
fi

It tests for the existence of the init file prior to creating a symlink (if [[ ! -e $initfile ]]; then). You might try adding an echo statement to help debug and get the values of the variables in question: echo initfile=$initfile plugin_dir=$plugin_dir and let me know what you find.

from zsh_unplugged.

EtherealMochi avatar EtherealMochi commented on May 18, 2024

Interesting. This is the relevant code block:

if [[ ! -e $initfile ]]; then
initfiles=($plugin_dir/*.plugin.{z,}sh(N) $plugin_dir/*.{z,}sh{-theme,}(N))
[[ ${#initfiles[@]} -gt 0 ]] || { echo >&2 "Plugin has no init file '$repo'." && continue }
ln -s "${initfiles[1]}" "$initfile"
fi

It tests for the existence of the init file prior to creating a symlink (if [[ ! -e $initfile ]]; then). You might try adding an echo statement to help debug and get the values of the variables in question: echo initfile=$initfile plugin_dir=$plugin_dir and let me know what you find.

The echo output was showing the symlinks in initfile.

After doing some more researching I figured out what the issue is in my case. On my main machine it creates the symbolic links with the full path. When I use chezmoi to pull my config to my other machines it pulls those symbolic links as well but they are broken. Somehow that was causing the function to try and recreate the symlinks. I corrected this by changing line 20 to use relative paths instead of absolute. Now it is working on all my machines with no errors.

ln -sr "${initfiles[1]}" "$initfile"

from zsh_unplugged.

mattmc3 avatar mattmc3 commented on May 18, 2024

Clever! The BSD ln that ships with MacOS doesn't have the -r option, so I can't incorporate that or I'd have to have everyone on MacOS brew install coreutils, so for now we'll just mark this is resolved.

from zsh_unplugged.

EtherealMochi avatar EtherealMochi commented on May 18, 2024

@mattmc3 I completely understand and I have no problem with doing the change on my end only. Thanks for working with me today.

from zsh_unplugged.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.