Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fisher doesn't load plugins when using custom XDG_CONFIG_HOME #462

Closed
arwtyxouymz opened this issue Oct 7, 2018 · 54 comments
Closed

Fisher doesn't load plugins when using custom XDG_CONFIG_HOME #462

arwtyxouymz opened this issue Oct 7, 2018 · 54 comments
Labels
bug Something isn't working

Comments

@arwtyxouymz
Copy link

Hi,
I use fisher and it's very fantastic plugin manager!

But one problem occur when i'm setting up new laptop.

my problem

When i execute fisher add ......... command and add plugins to fish shell, the plugins are recognized fish shell.
On the other hand, after close the terminal and open new one, fish doesn't recognize them.
why?
I tried login shell and interactive shell, but both are doesn't work.

fisher ls command returns my plugins.

~/.config/fisher/0rax/fish-bd
~/.config/fisher/edc/bass
~/.config/fisher/fisherman/getopts
~/.config/fisher/fisherman/spin
~/.config/fisher/fisherman/z
~/.config/fisher/oh-my-fish/plugin-peco
~/.config/fisher/oh-my-fish/theme-bobthefish

my environment

  • Ubuntu 16.04
  • fish 2.7.1
  • fisher 3.0.6
@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz What are the contents of your fishfile?

fisher ls shouldn't produce that output. It looks like the directory structure that V2 used to create. How did you upgrade to V3 and did you go over the migration guide? → #450

@arwtyxouymz
Copy link
Author

@jorgebucaran
I followed that guide.
And my fishfile is

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

What is wrong?

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz Your fishfile looks perfect.

I don't know what's wrong. There is not enough information to make an assessment. I can see from the output of fisher ls that something is wrong.

What is the output of:

la ~/.config/fisher

It should be:

total 0
drwxr-xr-x   3 x  staff    96B Oct  7 23:03 .
drwxr-x---  12 x  staff   384B Oct  7 23:03 ..
drwxr-xr-x   3 x  staff    96B Oct  7 23:03 github.com

@jorgebucaran
Copy link
Owner

@arwtyxouymz Let's try something. Runfisher and paste the output logged to the terminal.

@arwtyxouymz
Copy link
Author

@jorgebucaran

Firstly, the output of la ~/.config/fisher is

合計 12K
drwxrwxr-x  3 ryutaro ryutaro 4.0K 10月  7 23:44 ./
drwx------ 24 ryutaro ryutaro 4.0K 10月  7 23:44 ../
drwxrwxr-x  6 ryutaro ryutaro 4.0K 10月  7 23:44 github.com/

sorry that output is japanese....

Next, the log of fisher command is

To completely erase z's data, remove:
/home/ryutaro/.local/share/z/datafetching https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master
fetching https://codeload.github.com/edc/bass/tar.gz/master
fetching https://codeload.github.com/0rax/fish-bd/tar.gz/master
fetching https://codeload.github.com/fisherman/spin/tar.gz/master
fetching https://codeload.github.com/fisherman/z/tar.gz/master
fetching https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master
linking __bobthefish_colors.fish
linking __bobthefish_display_colors.fish
linking __bobthefish_glyphs.fish
linking bobthefish_display_colors.fish
linking fish_greeting.fish
linking fish_mode_prompt.fish
linking fish_prompt.fish
linking fish_right_prompt.fish
linking fish_title.fish
linking __bass.py
linking bass.fish
linking bd.fish
linking uninstall.fish
linking bd.fish
linking spin.fish
linking spin.fish
linking __z.fish
linking __z_add.fish
linking __z_clean.fish
linking __z_complete.fish
linking uninstall.fish
linking z.fish
linking peco_kill.fish
linking peco_select_history.fish
fetching https://codeload.github.com/fisherman/getopts/tar.gz/master
linking getopts.fish
added 7 packages, removed 7 packages in 4682.35s

After fisher command, plugins are loaded.
But some *.fish files are generated to $HOME directory in spite of $XDG_CONFIG_HOME is set to ~/.config/

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz Hmm. Can you show me the value of the following variables?

echo $HOME
echo $XDG_CONFIG_HOME
echo $fisher_config
echo $fisher_cache
echo $fisher_path

@arwtyxouymz
Copy link
Author

@jorgebucaran

$HOME
/home/ryutaro

$XDG_CONFIG_HOME
/home/ryutaro/.config/

$fisher_config

$fisher_cache

$fisher_path

$fisher_* is all empty, but i can use fisher command.

@jorgebucaran
Copy link
Owner

@arwtyxouymz The $fisher_* variables will be empty on a new shell, as they are not meant to be used by you. But if you run fisher they will become visible as they're global variables. Could you make sure they are really empty?

Start a new shell session and run fisher then show me the content of the variables again. They shouldn't be empty if everything is working normally.

@arwtyxouymz
Copy link
Author

@jethrokuan
After fisher command,

$fisher_config
/home/ryutaro/.config/fisher

$fisher_cache
/home/ryutaro/.cache/fisher

$fisher_path
/home/ryutaro/.config/fish

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz Intriguing. Can I have your awk and sed versions?

Also, does a tilde ~ expand to your home directory as usual?

echo ~
/home/ryutaro

@arwtyxouymz
Copy link
Author

@jethrokuan

sed version is 4.2.2
awk(mawk) version is 1.3.3

Yeah, tilde expand to home directory.

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz This could be a problem with $IFS (internal field separator). 🤔

Can you open your ~/.config/fish/fisher.fish file, go to this line:

fisher/fisher.fish

Lines 228 to 234 in 226c0d9

pkg ~ /^bitbucket\.org/ ? "https://"pkg"/get/"tag".tar.gz" : pkg \
) "\t" pkg
}' | read -l url pkg
if test ! -d "$fisher_config/$pkg"
fish -c "
echo fetching $url >&2

...and add the following error log:

echo ">> URL ($url)" >&2
echo ">> PKG ($pkg)" >&2

If my guess is right, $url should be correct, but $pkg will be empty on your system.

@jorgebucaran
Copy link
Owner

@arwtyxouymz Is this you config.fish? Only momentarily, remove these lines and run fisher in a new shell session. Then shoe me the log again. 🙏

@arwtyxouymz
Copy link
Author

@jethrokuan
Is this function called when fish shell starts up?
When fish shell starts up, nothing is appeared.

But after fisher command, the output is this

To completely erase z's data, remove:
/home/ryutaro/.local/share/z/data>> URL (https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master)
>> PKG (github.com/oh-my-fish/theme-bobthefish)
>> URL (https://codeload.github.com/edc/bass/tar.gz/master)
>> PKG (github.com/edc/bass)
>> URL (https://codeload.github.com/0rax/fish-bd/tar.gz/master)
>> PKG (github.com/0rax/fish-bd)
>> URL (https://codeload.github.com/fisherman/spin/tar.gz/master)
>> PKG (github.com/fisherman/spin)
>> URL (https://codeload.github.com/fisherman/z/tar.gz/master)
>> PKG (github.com/fisherman/z)
fetching https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master
>> URL (https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master)
>> PKG (github.com/oh-my-fish/plugin-peco)
fetching https://codeload.github.com/edc/bass/tar.gz/master
fetching https://codeload.github.com/0rax/fish-bd/tar.gz/master
fetching https://codeload.github.com/fisherman/spin/tar.gz/master
fetching https://codeload.github.com/fisherman/z/tar.gz/master
fetching https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master
linking __bobthefish_colors.fish
linking __bobthefish_display_colors.fish
linking __bobthefish_glyphs.fish
linking bobthefish_display_colors.fish
linking fish_greeting.fish
linking fish_mode_prompt.fish
linking fish_prompt.fish
linking fish_right_prompt.fish
linking fish_title.fish
linking __bass.py
linking bass.fish
linking bd.fish
linking uninstall.fish
linking bd.fish
linking spin.fish
linking spin.fish
linking __z.fish
linking __z_add.fish
linking __z_clean.fish
linking __z_complete.fish
linking uninstall.fish
linking z.fish
linking peco_kill.fish
linking peco_select_history.fish
>> URL (https://codeload.github.com/fisherman/getopts/tar.gz/master)
>> PKG (github.com/fisherman/getopts)
fetching https://codeload.github.com/fisherman/getopts/tar.gz/master
linking getopts.fish
added 7 packages, removed 7 packages in -2821.75s

@arwtyxouymz
Copy link
Author

@jethrokuan

Yeah, but it's my OS X version config.fish.
Now i use Ubuntu 16.04, and my config.fish is

set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
for file in $XDG_CONFIG_HOME/fish/conf.d/*.fish
    buildin source $file 2>/dev/null
end

# tmux
if status is-interactive; and not set -q TMUX
    set create_new_session "new"
    if tmux ls > /dev/null ^ /dev/null
        set IFS
        set ID (tmux ls)
        set IFS \n" "\t
        set ID "$ID\n$create_new_session:"
    else
        set ID "$create_new_session:"
    end

    set ID (echo -e $ID | peco | cut -d: -f1)

    if test "$ID" = "$create_new_session"
        tmux new-session
    else if test -n "$ID"
        tmux attach -t $ID
    else
        echo "Start as a normal shell"
    end
end

if not functions -q fisher
    echo "Installing fisher for the first time..." >&2
    set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
    curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
    fisher
end

# キーバインディング
function fish_user_key_bindings
  bind \cr peco_select_history
end

# cd のあとに ls -a
function cd
  builtin cd $argv
  ls -a
end

# theme設定
set -g theme_display_git yes
set -g theme_display_git_untracked yes
set -g theme_display_git_master_branch yes
set -g theme_title_use_abbreviated_path no
set -g fish_prompt_pwd_dir_length 0
set -g theme_project_dir_length 0
set -g theme_newline_cursor yes

alias vi nvim
alias vim nvim

# cmakeプロジェクトの初期化
function CppInitialize
    mkdir -p ./build/
    touch ./CMakeLists.txt
    touch ./main.cpp
end

# build
function build
    if test -x (command -v clang)
        cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
        if test -x (command -v compdb)
            compdb list > ../compile_commands.json
        else
            echo "\e[33mWarning: compdb is not installed"
        end
    else
        cmake ..
        echo "\e[33mWarning: clang is not installed, using default compiler"
    end
end

And after i delete about tmux line that you specified, the fisher output is

To completely erase z's data, remove:
/home/ryutaro/.local/share/z/data>> URL (https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master)
>> PKG (github.com/oh-my-fish/theme-bobthefish)
>> URL (https://codeload.github.com/edc/bass/tar.gz/master)
>> PKG (github.com/edc/bass)
>> URL (https://codeload.github.com/0rax/fish-bd/tar.gz/master)
>> PKG (github.com/0rax/fish-bd)
>> URL (https://codeload.github.com/fisherman/spin/tar.gz/master)
>> PKG (github.com/fisherman/spin)
>> URL (https://codeload.github.com/fisherman/z/tar.gz/master)
>> PKG (github.com/fisherman/z)
fetching https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master
>> URL (https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master)
fetching https://codeload.github.com/edc/bass/tar.gz/master
>> PKG (github.com/oh-my-fish/plugin-peco)
fetching https://codeload.github.com/0rax/fish-bd/tar.gz/master
fetching https://codeload.github.com/fisherman/spin/tar.gz/master
fetching https://codeload.github.com/fisherman/z/tar.gz/master
fetching https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master
linking __bobthefish_colors.fish
linking __bobthefish_display_colors.fish
linking __bobthefish_glyphs.fish
linking bobthefish_display_colors.fish
linking fish_greeting.fish
linking fish_mode_prompt.fish
linking fish_prompt.fish
linking fish_right_prompt.fish
linking fish_title.fish
linking __bass.py
linking bass.fish
linking bd.fish
linking uninstall.fish
linking bd.fish
linking spin.fish
linking spin.fish
linking __z.fish
linking __z_add.fish
linking __z_clean.fish
linking __z_complete.fish
linking uninstall.fish
linking z.fish
linking peco_kill.fish
linking peco_select_history.fish
>> URL (https://codeload.github.com/fisherman/getopts/tar.gz/master)
>> PKG (github.com/fisherman/getopts)
fetching https://codeload.github.com/fisherman/getopts/tar.gz/master
linking getopts.fish
added 7 packages, removed 7 packages in -2545.74s

@jorgebucaran
Copy link
Owner

@arwtyxouymz Is this function called when fish shell starts up?

No, it is not. Nothing is run on shell startup. Please read my comment above.

And by the way, my GitHub username is:

@jorgebucaran

@arwtyxouymz
Copy link
Author

@jorgebucaran

I'm so sorry........
I misunderstood ....

@jorgebucaran
Copy link
Owner

@arwtyxouymz It looks like $IFS was not the problem after all. Good to know.

The problem is somewhere in this function:

fisher/fisher.fish

Lines 292 to 319 in 226c0d9

function _fisher_pkg_install -a pkg
set -l name (echo $pkg | command sed "s|^.*/||")
set -l files $pkg/{functions,completions,conf.d}/* $pkg/*.fish
for source in $files
set -l target (echo "$source" | command sed 's|^.*/||')
switch $source
case $pkg/conf.d\*
set target $fisher_path/conf.d/$target
case $pkg/completions\*
set target $fisher_path/completions/$target
case $pkg/{functions,}\*
switch $target
case uninstall.fish
continue
case init.fish key_bindings.fish
set target $fisher_path/conf.d/$name\_$target
case \*
set target $fisher_path/functions/$target
end
end
echo "linking $target" | command sed "s|$HOME|~|" >&2
command ln -f $source $target
switch $target
case \*.fish
source $target >/dev/null 2>/dev/null
end
end
end

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz Fisher is downloading packages to the correct location, but there is obviously a problem during linking. Also, your fisher ls output seems wrong.

Can you confirm that fisher ls produces the following output?

~/.config/fisher/0rax/fish-bd
~/.config/fisher/edc/bass
~/.config/fisher/fisherman/getopts
~/.config/fisher/fisherman/spin
~/.config/fisher/fisherman/z
~/.config/fisher/oh-my-fish/plugin-peco
~/.config/fisher/oh-my-fish/theme-bobthefish

@jorgebucaran
Copy link
Owner

@arwtyxouymz I'm starting to think this could be a problem with sed.

Please run this and show me the output.

printf "%s\n" $fisher_config/*/*/* | sed "s|$fisher_config/||;s|github\.com/||" 

@arwtyxouymz
Copy link
Author

@jorgebucaran

Yeah fisher ls output is that one.

printf "%s\n" $fisher_config/*/*/* | sed "s|$fisher_config/||;s|github\.com/||" 

output is

/home/ryutaro/.config/fisher/0rax/fish-bd
/home/ryutaro/.config/fisher/edc/bass
/home/ryutaro/.config/fisher/fisherman/getopts
/home/ryutaro/.config/fisher/fisherman/spin
/home/ryutaro/.config/fisher/fisherman/z
/home/ryutaro/.config/fisher/oh-my-fish/plugin-peco
/home/ryutaro/.config/fisher/oh-my-fish/theme-bobthefish

@jorgebucaran
Copy link
Owner

@arwtyxouymz Okay, and what about:

printf "%s\n" $fisher_config/*/*/*

@arwtyxouymz
Copy link
Author

@jorgebucaran
It's same with just before command.

/home/ryutaro/.config/fisher/github.com/0rax/fish-bd
/home/ryutaro/.config/fisher/github.com/edc/bass
/home/ryutaro/.config/fisher/github.com/fisherman/getopts
/home/ryutaro/.config/fisher/github.com/fisherman/spin
/home/ryutaro/.config/fisher/github.com/fisherman/z
/home/ryutaro/.config/fisher/github.com/oh-my-fish/plugin-peco
/home/ryutaro/.config/fisher/github.com/oh-my-fish/theme-bobthefish

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz The sed command is not producing the right output. Only github.com is being removed from the string. But $fisher_config (/home/ryutaro/.config/fisher/) is not.

@jorgebucaran
Copy link
Owner

@arwtyxouymz Could you run this please? The following has nothing to do with fisher, we're just testing sed is working like I think it should on your system.

echo /home/ryutaro/.config/fisher/github.com/BAR/BAZ | sed "s|/home/ryutaro/.config/fisher/||"
echo /home/ryutaro/.config/fisher/github.com/BAR/BAZ | sed "s|/home/ryutaro/.config/fisher/||;s|github\.com/||"

My output is:

github.com/BAR/BAZ
BAR/BAZ

@arwtyxouymz
Copy link
Author

@jorgebucaran

My output is also

github.com/BAR/BAZ
BAR/BAZ

@jorgebucaran
Copy link
Owner

@arwtyxouymz Try these please:

printf "%s\n" $fisher_config/*/*/* | sed "s|/home/ryutaro/.config/fisher/||;s|github\.com/||" 
printf "%s\n" $fisher_config/*/*/* | sed "s|$fisher_config/||;s|github\.com/||" 

@arwtyxouymz
Copy link
Author

@jorgebucaran

First one is

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

Second is

/home/ryutaro/.config/fisher/0rax/fish-bd
/home/ryutaro/.config/fisher/edc/bass
/home/ryutaro/.config/fisher/fisherman/getopts
/home/ryutaro/.config/fisher/fisherman/spin
/home/ryutaro/.config/fisher/fisherman/z
/home/ryutaro/.config/fisher/oh-my-fish/plugin-peco
/home/ryutaro/.config/fisher/oh-my-fish/theme-bobthefish

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz They should have the same output.

The value of $fisher_config is /home/ryutaro/.config/fisher correct?

@arwtyxouymz
Copy link
Author

@jorgebucaran

Yes.

@arwtyxouymz
Copy link
Author

@jorgebucaran

It's sed problem?
Should i reinstall sed?

@jorgebucaran
Copy link
Owner

Based on this #462 (comment) it doesn't look like a sed problem. おもしろいねどうしよう 😆

@jorgebucaran
Copy link
Owner

@arwtyxouymz Let's try something simpler:

echo $fisher_config | sed "s|$fisher_config||"

That should print an empty string.

@arwtyxouymz
Copy link
Author

@jorgebucaran
Exactly an empty string.

@jorgebucaran
Copy link
Owner

Please confirm also:

test $fisher_config = /home/ryutaro/.config/fisher; and echo OK

@arwtyxouymz
Copy link
Author

@jorgebucaran

Yeah it's OK

@jorgebucaran
Copy link
Owner

Could it be a problem with multiple lines? What if we echo only one line?

echo /home/ryutaro/.config/fisher/github.com/edc/bass | sed "s|$fisher_config/||"

Should print

github.com/edc/bass

@arwtyxouymz
Copy link
Author

This command prints

github.com/edc/bass

correctly.

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

One line works. What about multiple lines?

printf "%s\n" /home/ryutaro/.config/fisher/github.com/edc/bass /home/ryutaro/.config/fisher/fisherman/z | sed "s|$fisher_config/||"

It should be:

github.com/edc/bass
fisherman/z

@arwtyxouymz
Copy link
Author

github.com/edc/bass
fisherman/z

is output.

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

That's what I expect. Let's see.

Printf a glob expansion.

printf "%s\n" $fisher_config/*/*/*

Then pipe it to sed.

printf "%s\n" $fisher_config/*/*/* | sed "s|$fisher_config/||" 

Then pipe it to sed using multiple replacements.

printf "%s\n" $fisher_config/*/*/* | sed "s|$fisher_config/||;s|github\.com/||" 

I expect.

/home/ryutaro/.config/fisher/github.com/0rax/fish-bd
/home/ryutaro/.config/fisher/github.com/edc/bass
/home/ryutaro/.config/fisher/github.com/fisherman/getopts
/home/ryutaro/.config/fisher/github.com/fisherman/spin
/home/ryutaro/.config/fisher/github.com/fisherman/z
/home/ryutaro/.config/fisher/github.com/oh-my-fish/plugin-peco
/home/ryutaro/.config/fisher/github.com/oh-my-fish/theme-bobthefish
github.com/0rax/fish-bd
github.com/edc/bass
github.com/fisherman/getopts
github.com/fisherman/spin
github.com/fisherman/z
github.com/oh-my-fish/plugin-peco
github.com/oh-my-fish/theme-bobthefish
0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

@arwtyxouymz
Copy link
Author

glob expansion:

/home/ryutaro/.config/fisher/github.com/0rax/fish-bd
/home/ryutaro/.config/fisher/github.com/edc/bass
/home/ryutaro/.config/fisher/github.com/fisherman/getopts
/home/ryutaro/.config/fisher/github.com/fisherman/spin
/home/ryutaro/.config/fisher/github.com/fisherman/z
/home/ryutaro/.config/fisher/github.com/oh-my-fish/plugin-peco
/home/ryutaro/.config/fisher/github.com/oh-my-fish/theme-bobthefish

sed:

github.com/0rax/fish-bd
github.com/edc/bass
github.com/fisherman/getopts
github.com/fisherman/spin
github.com/fisherman/z
github.com/oh-my-fish/plugin-peco
github.com/oh-my-fish/theme-bobthefish

multiple replacements:

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

@jorgebucaran
Copy link
Owner

@arwtyxouymz That's not what you said here in this #462 (comment).

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 7, 2018

@arwtyxouymz You are giving me contradictory information.

Let's try again. But first to be sure:

type _fisher_ls

Okay, now, please run and show me your output.

echo $fisher_config
printf "%s\n" $fisher_config/*/*/*
printf "%s\n" $fisher_config/*/*/* | sed "s|$fisher_config/||;s|github\.com/||" 
for pkg in $fisher_config/*/*/*
    command readlink $pkg
    and continue
    or echo $pkg
end | command sed "s|$fisher_config/||;s|github\.com/||"
_fisher_ls
fisher ls

They all should have the same output.

@arwtyxouymz
Copy link
Author

@jorgebucaran

I think that's because i changed XDG_CONFIG_HOME from /home/ryutaro/.config/ to /home/ryutaro/.config.

I didn't think this change cause big difference in sed command.

@jorgebucaran
Copy link
Owner

@arwtyxouymz Ah, okay that explains the problem. I think I can fix that by making the trailing slash / optional in the sed regex.

@jorgebucaran
Copy link
Owner

@arwtyxouymz Is everything working now?

@arwtyxouymz
Copy link
Author

First one is

# Defined in /home/ryutaro/.config/fish/functions/fisher.fish @ line 82
function _fisher_ls
    set -l pkgs $fisher_config/*/*/*
    for pkg in $pkgs
        command readlink $pkg
        and continue
        or echo $pkg
    end | command sed "s|$fisher_config/||;s|github\.com/||"
end

Second one (printf one) is

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

Third one (for statement) is

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

Forth one (_fisher_ls) is

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

Fifth one (fisher ls) is

0rax/fish-bd
edc/bass
fisherman/getopts
fisherman/spin
fisherman/z
oh-my-fish/plugin-peco
oh-my-fish/theme-bobthefish

@arwtyxouymz
Copy link
Author

And plugins are loaded!

Thank you so much!!!

What was a problem?

@jorgebucaran
Copy link
Owner

@arwtyxouymz Just to be double sure. Could you run fisher and show me the log one more time now that everything seems to be working correctly?

@jorgebucaran
Copy link
Owner

@arwtyxouymz What was a problem?

Problem was fixed by you changing XDG_CONFIG_HOME from /home/ryutaro/.config/ to /home/ryutaro/.config. So, the problem was the extra / at the end of the path. I can fix that by making the slash optional in the regex.

@arwtyxouymz
Copy link
Author

@jorgebucaran

fisher output is

To completely erase z's data, remove:
/home/ryutaro/.local/share/z/data>> URL (https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master)
>> PKG (github.com/oh-my-fish/theme-bobthefish)
>> URL (https://codeload.github.com/edc/bass/tar.gz/master)
>> PKG (github.com/edc/bass)
>> URL (https://codeload.github.com/0rax/fish-bd/tar.gz/master)
>> PKG (github.com/0rax/fish-bd)
>> URL (https://codeload.github.com/fisherman/spin/tar.gz/master)
>> PKG (github.com/fisherman/spin)
fetching https://codeload.github.com/oh-my-fish/theme-bobthefish/tar.gz/master
>> URL (https://codeload.github.com/fisherman/z/tar.gz/master)
>> PKG (github.com/fisherman/z)
>> URL (https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master)
>> PKG (github.com/oh-my-fish/plugin-peco)
fetching https://codeload.github.com/edc/bass/tar.gz/master
fetching https://codeload.github.com/0rax/fish-bd/tar.gz/master
fetching https://codeload.github.com/fisherman/spin/tar.gz/master
fetching https://codeload.github.com/fisherman/z/tar.gz/master
fetching https://codeload.github.com/oh-my-fish/plugin-peco/tar.gz/master
linking ~/.config/fish/functions/__bobthefish_colors.fish
linking ~/.config/fish/functions/__bobthefish_display_colors.fish
linking ~/.config/fish/functions/__bobthefish_glyphs.fish
linking ~/.config/fish/functions/bobthefish_display_colors.fish
linking ~/.config/fish/functions/fish_greeting.fish
linking ~/.config/fish/functions/fish_mode_prompt.fish
linking ~/.config/fish/functions/fish_prompt.fish
linking ~/.config/fish/functions/fish_right_prompt.fish
linking ~/.config/fish/functions/fish_title.fish
linking ~/.config/fish/functions/__bass.py
linking ~/.config/fish/functions/bass.fish
linking ~/.config/fish/functions/bd.fish
linking ~/.config/fish/completions/bd.fish
linking ~/.config/fish/completions/spin.fish
linking ~/.config/fish/functions/spin.fish
linking ~/.config/fish/functions/__z.fish
linking ~/.config/fish/functions/__z_add.fish
linking ~/.config/fish/functions/__z_clean.fish
linking ~/.config/fish/functions/__z_complete.fish
linking ~/.config/fish/conf.d/z.fish
linking ~/.config/fish/functions/peco_kill.fish
linking ~/.config/fish/functions/peco_select_history.fish
>> URL (https://codeload.github.com/fisherman/getopts/tar.gz/master)
>> PKG (github.com/fisherman/getopts)
fetching https://codeload.github.com/fisherman/getopts/tar.gz/master
linking ~/.config/fish/functions/getopts.fish
updated 7 packages in 2146.16s

Oh Thank you!
I'm really glad to use useful plugins.

@jorgebucaran
Copy link
Owner

@arwtyxouymz Glad to hear that!

BTW I noticed there's an issue with the printed time:

updated 7 packages in 2146.16s

I'll fix that too later.

I'll mention your name here when I have released a new version so you can self-update.

Thank you for your patience!

@jorgebucaran jorgebucaran added the bug Something isn't working label Oct 8, 2018
jorgebucaran added a commit that referenced this issue Oct 8, 2018
$fisher_config/foo/bar  → foo/bar
{$fisher_config}foo/bar → foo/bar
$fisher_config//foo/bar → foo/bar
@jorgebucaran
Copy link
Owner

@arwtyxouymz Fixed trailing slash error in 3.0.7 2549ac1. 🎉

Update to the latest fisher using:

fisher self-update

Cheers!

@jorgebucaran jorgebucaran changed the title Fisher doesn't load plugins Fisher doesn't load plugins when using custom XDG_CONFIG_HOME Oct 10, 2018
Repository owner locked as resolved and limited conversation to collaborators Oct 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants