freshshell / fresh

Keep your dotfiles fresh.
https://freshshell.com/
1.18k stars 88 forks source link

Cannot install on MSYS2 #177

Open go2null opened 2 years ago

go2null commented 2 years ago

I am running MSYS2 (from RubyInstaller) have same issue as described in #134.

jasoncodes commented 2 years ago

Hi there. I was able to reproduce this issue on MSYS2 where symlink creation fails if the target does not exist:

$ ln -s foo bar
ln: failed to create symbolic link 'bar': No such file or directory
$ ls -1 foo bar
ls: cannot access 'foo': No such file or directory
ls: cannot access 'bar': No such file or directory
$ touch foo
$ ln -s foo bar
$ ls -1 foo bar
bar
foo

This first test suggests MSYS2 requires the target to exist before creating symlinks. A further test though suggests MSYS2 doesn’t support symlinks and is instead creating copies instead:

$ echo one > foo
$ ln -s foo bar
$ echo two > foo
$ cat bar
one

Is this the same behaviour you are seeing? If so, I am not sure I want to hack fresh to support environments without working symlinks.

Now knowing what’s going on, I quickly found https://stackoverflow.com/a/61598448 which suggests setting MSYS to winsymlinks or winsymlinks:nativestrict should work. I just tried export MSYS=winsymlinks in my test environment and fresh now runs correctly. Please give this a go.