Closed vunhatchuong closed 8 months ago
Thanks Please wait for @juev's review
@kevincobain2000 has become much better now, but I still don't like the idea of calling third-party programs from the code.
In addition, Windows has a lot of shell, that is, many launch options and each may have its own problems.
In my opinion, if we have a problem with creating a simlink, we can simply copy the directory from a certain version to the current
directory.
For example, when it is necessary to switch the version:
versions
current
to versions
current
directoryversions/{version}
to currentIf it is not available, we download from the Internet accordingly.
Here you still need to think about how to solve the problem with copying the bin
directory. But it seems that it is much easier than starting individual processes.
What do you think?
Hi @juev Thanks for the review. I also do not prefer shell invoked as separate exec.
Your suggestion on version switch is good, it can be done natively - all in GO.
But again, it is windows, I didn't intend to support powershell in the first place, people could just wsl
instead.
Having said all that, if calling a separate powershell
command, temporarily solves this issue, then it is cool.
The same implementation will never get merged if it was a unix based os, and would code in GO.
Also I have a windows machine now, but hate the idea of powershell
in the first place. But people want it so be it as dirty as it can get.
If you are ok then I am also ok for this merge. It's not like it is changing anything for unix based os.
Let me know if you are ok with merge @juev
Thanks @juev will merge it after dinner
Problem
Symlink on Windows 10 Powershell required privilege, so we need to use
cmd
to create a symlink withmklink
. See issue https://github.com/kevincobain2000/gobrew/issues/174filepath.EvalSymlinks
doesn't work correctly on Windows. A fix is currently being proposed: https://github.com/golang/go/issues/63703