-
Notifications
You must be signed in to change notification settings - Fork 105
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
[WIP] Support for Windows ( bfirsh/whalebrew#29 ) #34
base: master
Are you sure you want to change the base?
Conversation
I can confirm that this works on Win 10 x64, Preview 15019 with latest docker for windows beta release. I used it with cmd, but also have msys2 installed and its binaries in my PATH (don't know if that's relevant). |
main.go
Outdated
// Check if not command exists | ||
if _, _, err := cmd.RootCmd.Find(os.Args); err != nil { | ||
// Check if file exists | ||
if _, err := os.Stat(os.Args[1]); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems even more flimsy than my hack. ;) e.g. I can envisage lots of stuff unexpectedly not working if they collide with command names.
You could just run whalebrew run [pkg]
in the batch script.
Thanks for this @3846masa! This is a great start. Some thoughts:
|
Didn't realize this PR existed and I've been working on my own branch to get whalebrew working on Windows. I found a problem with using |
Even running the |
More info: when you pass a commandline argument to the lynx command, it hangs and I thought it was only on windows, but it is happening on macOS as well:
So, I don't think there is a problem using command.Exec on Windows. I figured out a way to write out the batch files with YAML embedded too. |
1d95b0f
to
a7a4f02
Compare
Thanks for comments. I changed code.
|
I wrote TODO in first comment and changed PR title. |
cf83dff
to
3107cb8
Compare
I changed.
|
3107cb8
to
8ea45ff
Compare
8ea45ff
to
2b5145d
Compare
Bump to 0.1.0. |
Nice, thank you @3846masa! (and @mapitman!) I will take a proper look at this when I get some time. Would you be willing to help maintain the Windows support? I don't have a Windows machine so I am worried it will deteriorate unless somebody's keeping an eye on it. The CI will certainly help - thanks for that. :) Whalebrew seems pretty stable and feature complete now, so I doubt there'll be much involved. |
Ok, I'll help maintain for Windows. |
aea13b2
to
c48c383
Compare
Squashed commit of the following: commit b677dbc Author: 3846masa <[email protected]> Date: Sat Oct 28 11:35:30 2017 +0900 Fix golang version commit 43bc363 Author: 3846masa <[email protected]> Date: Sat Oct 28 11:12:42 2017 +0900 Fix shebang for Windows commit ed225df Author: 3846masa <[email protected]> Date: Fri Sep 8 10:29:39 2017 +0900 Fix CI commit 94a625d Author: 3846masa <[email protected]> Date: Fri Sep 8 10:26:49 2017 +0900 Fix windows installer commit 0bea8fb Author: 3846masa <[email protected]> Date: Fri Sep 8 10:26:20 2017 +0900 Fix README for Windows installer commit 237a4a7 Author: 3846masa <[email protected]> Date: Thu Sep 7 19:11:19 2017 +0900 Fix build for Windows commit bc508d7 Author: 3846masa <[email protected]> Date: Thu Sep 7 18:59:16 2017 +0900 Fix to set API version (moby/moby#32779) commit 442be2f Author: 3846masa <[email protected]> Date: Thu Sep 7 18:03:01 2017 +0900 Update README for Windows commit e83b2ed Author: 3846masa <[email protected]> Date: Thu Sep 7 18:01:01 2017 +0900 Add installer for Windows commit 776b931 Author: 3846masa <[email protected]> Date: Thu Sep 7 18:00:38 2017 +0900 Build for Windows commit bc01aef Author: 3846masa <[email protected]> Date: Thu Sep 7 17:43:43 2017 +0900 Fix `run.go` for Windows commit 63b9490 Merge: a72237f 0fea7e2 Author: 3846masa <[email protected]> Date: Thu Sep 7 17:43:01 2017 +0900 Merge tag '0.1.0' of https://github.com/bfirsh/whalebrew into support-windows commit a72237f Author: 3846masa <[email protected]> Date: Thu Sep 7 17:26:29 2017 +0900 Fix `ForceInstall` for windows commit de458d9 Merge: 03d00bf e7d0792 Author: 3846masa <[email protected]> Date: Thu Sep 7 17:22:41 2017 +0900 Merge tag '0.0.5' into support-windows commit 03d00bf Author: 3846masa <[email protected]> Date: Tue Feb 14 00:01:52 2017 +0900 Fix batch file's shebang commit 21bcf14 Author: 3846masa <[email protected]> Date: Mon Feb 13 22:19:25 2017 +0900 Fix .travis.yml for forked project commit a0e486c Author: 3846masa <[email protected]> Date: Mon Feb 13 21:59:19 2017 +0900 Add appveyor.yml commit fe06f35 Author: 3846masa <[email protected]> Date: Mon Feb 13 21:34:46 2017 +0900 MakePackagePath commit bc12aa0 Author: 3846masa <[email protected]> Date: Mon Feb 13 21:23:31 2017 +0900 Rewrite test commit 7453d37 Author: 3846masa <[email protected]> Date: Mon Feb 13 20:28:33 2017 +0900 `path.Join` -> `filepath.Join` commit 4ded1a2 Author: 3846masa <[email protected]> Date: Mon Feb 13 16:53:51 2017 +0900 LF -> CRLF in batch file commit 8078165 Author: 3846masa <[email protected]> Date: Mon Feb 13 16:34:08 2017 +0900 Fix edit for Windows commit 8746496 Author: 3846masa <[email protected]> Date: Mon Feb 13 16:15:55 2017 +0900 Fix run for windows commit bb652d4 Merge: 8a6d783 e7e6427 Author: 3846masa <[email protected]> Date: Mon Feb 13 16:08:42 2017 +0900 Merge v0.0.4 Merge remote-tracking branch 'origin/master' into support-windows commit 8a6d783 Author: 3846masa <[email protected]> Date: Sun Feb 5 21:11:59 2017 +0900 Support to run and return status code on Windows commit ce3d298 Author: 3846masa <[email protected]> Date: Sun Feb 5 20:58:21 2017 +0900 Revert "syscall -> exec (for working on windows)" This reverts commit 276a9cd. commit ffbdd15 Author: 3846masa <[email protected]> Date: Sun Feb 5 20:50:08 2017 +0900 Add batch file support (for working on windows) commit cdc5a05 Author: 3846masa <[email protected]> Date: Sun Feb 5 20:34:30 2017 +0900 Revert "Add batch file support (for working on windows)" This reverts commit aba79b0. commit 10e10a0 Author: 3846masa <[email protected]> Date: Fri Feb 3 00:53:23 2017 +0900 Revert "Fix checking args (for working on windows)" This reverts commit 926f422. commit 74db526 Author: 3846masa <[email protected]> Date: Wed Feb 1 03:14:59 2017 +0900 Fix default WHALEBREW_INSTALL_PATH (for working on windows) commit aba79b0 Author: 3846masa <[email protected]> Date: Wed Feb 1 03:06:00 2017 +0900 Add batch file support (for working on windows) commit 926f422 Author: 3846masa <[email protected]> Date: Wed Feb 1 01:45:51 2017 +0900 Fix checking args (for working on windows) commit 276a9cd Author: 3846masa <[email protected]> Date: Wed Feb 1 01:36:56 2017 +0900 syscall -> exec (for working on windows)
c48c383
to
f74c60d
Compare
Is there a timeline for this? |
Hi @asadakbarml thanks for the heads up. |
Whalebrew on Windows 🐋 🎉 🐳 ( #29 )
I checked on cmd and MSYS2 bash with Docker for Windows.
PR for Windows
syscall -> exec (3846masa@8a6d783)
To change
syscall.Exec
toexec.Command
becausesyscall.Exec
causes Error on Windows.Fix checking argsFirst argument checking hack is not working on Windows. I changed it.Add batch file support (3846masa@ffbdd15)
When
whalebrew install
on Windows, generate batch file.Batch file passes shell file and args towhalebrew
.Fix default WHALEBREW_INSTALL_PATH (3846masa@74db526)
I have no idea where is good for install_path on Windows.
Temporally,
WHALEBREW_INSTALL_PATH
isC:\whalebrew
if on Windows.Add install script for Windows (3846masa@94a625d)
Install script will download
whalebrew.exe
and setPath
andWHALEBREW_INSTALL_PATH
.path.Join
->filepath.Join
(3846masa@7453d37)c.f. ) http://stackoverflow.com/questions/9371031/how-do-i-create-crossplatform-file-paths-in-go
Rewrite test for Windows (3846masa@bc12aa0)
Add
MakePackagePath
function (3846masa@fe06f35)Because package file name is different on Windows and *nix
TODO
WHALEBREW_INSTALL_PATH
on WindowsThis is first time to write golang. Please check changes. 🙏
Thanks.