reitzig / sdkman-for-fish

Adds support for SDKMAN! to fish
MIT License
280 stars 13 forks source link

Errors in initialization scripts (Windows + mingw) #40

Closed delirial closed 2 years ago

delirial commented 2 years ago

I want to use this feature in mingw on Windows. When i try the fresh install with fisher install reitzig/sdkman-for-fish this just work, but in bootstrap of fish throw this:

fish: Unknown command: env
~/.config/fish/conf.d/sdk.fish (line 22):
          or    env test "$__fish_sdkman_init" -nt "$__fish_sdkman_noexpor
t_init"
                ^
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
fish: Unknown command: mktemp
~/.config/fish/conf.d/sdk.fish (line 1):
mktemp
^
in command substitution
        called on line 40 of file ~/.config/fish/conf.d/sdk.fish
in function '__fish_sdkman_run_in_bash' with arguments 'source\ /home/onie
lsen/.sdkman/bin/sdkman-init.sh'
        called on line 82 of file ~/.config/fish/conf.d/sdk.fish
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
~/.config/fish/conf.d/sdk.fish (line 40): Unknown error while evaluating c
ommand substitution
    set pipe (mktemp)
             ^
in function '__fish_sdkman_run_in_bash' with arguments 'source\ /home/onie
lsen/.sdkman/bin/sdkman-init.sh'
        called on line 82 of file ~/.config/fish/conf.d/sdk.fish
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
/bin/bash: /home/onielsen/.sdkman/bin/sdkman-init.sh: No such file or dire
ctory
/bin/bash: -c: line 1: syntax error near unexpected token `;'
/bin/bash: -c: line 1: `             echo -e "0" > ;'
fish: Unknown command: cat
~/.config/fish/conf.d/sdk.fish (line 1):
cat $pipe; rm $pipe
^
in command substitution
in function '__fish_sdkman_run_in_bash' with arguments 'source\ /home/onielsen/.sdkman/bin/sdkman-init.sh'
        called on line 82 of file ~/.config/fish/conf.d/sdk.fish
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
fish: Unknown command: rm
~/.config/fish/conf.d/sdk.fish (line 1):
cat $pipe; rm $pipe
           ^
in command substitution
        called on line 46 of file ~/.config/fish/conf.d/sdk.fish
in function '__fish_sdkman_run_in_bash' with arguments 'source\ /home/onielsen/.sdkman/bin/sdkman-init.sh'
        called on line 82 of file ~/.config/fish/conf.d/sdk.fish
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
~/.config/fish/conf.d/sdk.fish (line 46): Unknown error while evaluating command substitution
    set bashDump (cat $pipe; rm $pipe)
                 ^
in function '__fish_sdkman_run_in_bash' with arguments 'source\ /home/onielsen/.sdkman/bin/sdkman-init.sh'
        called on line 82 of file ~/.config/fish/conf.d/sdk.fish
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
[: Missing argument at index 3
= 0
    ^
~/.config/fish/conf.d/sdk.fish (line 53):
    if [ $sdkStatus = 0 ]
       ^
in function '__fish_sdkman_run_in_bash' with arguments 'source\ /home/onielsen/.sdkman/bin/sdkman-init.sh'
        called on line 82 of file ~/.config/fish/conf.d/sdk.fish
from sourcing file ~/.config/fish/conf.d/sdk.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup

And sdk not works anymore.

reitzig commented 2 years ago

I'm afraid I can't support Windows; I don't even know what "mingw" is. :shrug:

From the error messages, it seems like you don't have GNU core tools/utils installed, or they are not on the PATH. I suspect that if you remedy that, the scripts will work. Ultimately, though, it depends on whether that environment mimicks UNIX-ish accurately enough. (Keeping things running on both GNU/Linux and "BSD"/macOS is fun enough, believe you me ...)

Closing since this doesn't seem to be an issue we can address here. Good luck!

reitzig commented 2 years ago

Oh, general note: I've been long overdue releasing a new version. There are some fixes for assorted buggies on branch dev, so if you get past this here and still get errors, you may want to try that one.