-
Notifications
You must be signed in to change notification settings - Fork 617
Conversation
Conflicts: src/Aliases.ts src/CommandExecutor.ts src/Invocation.ts
@@ -51,6 +51,12 @@ class BuiltInCommandExecutionStrategy extends CommandExecutionStrategy { | |||
class SystemFileExecutionStrategy extends CommandExecutionStrategy { | |||
startExecution() { | |||
return new Promise((resolve, reject) => { |
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.
The purpose of the strategy classes is to replace conditions with polymorphism. Please create a separate strategy for Windows. You might want to extract the common pieces into an intermediate super class.
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.
I've refactored the way we choose a strategy to make it easier to extend. Sorry, if it created conflicts.
Conflicts: src/Aliases.ts src/Buffer.ts src/Command.ts
Done, check now @ShockOne |
@@ -63,6 +64,47 @@ class SystemFileExecutionStrategy extends CommandExecutionStrategy { | |||
} | |||
} | |||
|
|||
class WindowsSystemFileExecutionStrategy extends CommandExecutionStrategy { | |||
static canExecute(command: string): Promise<boolean> { | |||
return new Promise(resolve => Utils.getExecutablesInPaths().then(executables => resolve(_.include(executables, command)))); |
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.
I guess this should be
return new Promise(resolve => resolve(Utils.isWindows()));
Can you fix #129 (diff) for me? I can't find a good way to do that and also I find this like there are a lot of functions which doesn't need to be inside a class. Regarding the enum suggestion (#129 (diff)), why would you like to do something like that? I mean, I see this also like unecessary code for a thing that can be done with a single function. |
@iiegor, I'll do that in the evening. Regarding enums, maybe it's just me, but I thought it's a common practice to avoid string literals comparison. With enums you always know the list of the values that exist instead of guessing whether it's 'win', 'Win', 'windows', or something else. And the program doesn't compile if you misspell the word. Anyway, it's not important, if you don't agree, I don't insist. |
@iiegor I figured I can merge and then change the hierarchy on my own. Also, I want you to know that this pull request is the most valuable contribution so far. Thank you very much. May I ask if you plan to continue helping the project? |
Standalone windows patch
@ShockOne Yes I will, love this project 😄 Edit: Oh, I forgot to tell you that windows users will need to run: |
@iiegor we need to figure out how to make that happen for them automatically. |
@iiegor Does not work on Windows 10.
|
@iiegor, well, if we have to. But before that, could you check if you can make |
@MarkTiedemann Same thing here. |
@onbjerg d:\Microsoft.Cpp.Default.props is missing, download Visual Studio 2013 and try again, please. Also, can you create an issue for this? so others users can find the solution @ShockOne Running:
should work but electron-rebuild is giving me errors so if anyone can test this will be great. |
So the Visual Studio 2013 Redist is not enough? @iiegor |
@onbjerg I don't know, I think is not enough... I have Visual Studio 2013, Python 2.7 and the latest node-gyp and works perfect, can you try with that? or try running this commands with Visual Studio 2013 installed:
|
I've tried exporting those variables, but I would not use black-screen if I need to have Visual Studio 2013 installed. Visual Studio bloats my system with a lot of programs that I do not need, because it installs a ton of different packages. I'm never going to use it, so I would rather not. It is a weird issue, though, as I have no problem building and packaging my own electron projects under Windows, even though some of them also require a rebuild of some modules. |
@onbjerg "...but I would not use black-screen if I need to have Visual Studio 2013 installed..." @ALL |
@jerch You mean distribution binaries for ptyw.js without compiling with node-gyp? If this is what you mean, I think it's possible, try with this pre-compiled binaries by me: https://www.dropbox.com/s/0h8kuo35r508te1/Release.zip?dl=0 (unzip this in node_modules/ptyw.js/build) @onbjerg What are your intentions? I mean, if you want to compile yourself a binary of black-screen on windows I'm afraid you will need to have VS2013 installed or if you can wait, I will compile the respective binary files when black-screen reaches a stable release. Anyway, you can try to download the binaries (link above) of ptyw.js for windows and check if works, so you won't need to have VS2013. Steps to build on windows
My english is not very good so if someone could put this in the README would be great. |
@iiegor When you say The command Also worth noting that for both Either way, I followed the steps you described, using the master branch. I managed to get all steps to work (on the second step, However, I still couldn't get the binary to properly work. At first, I was getting the following error (loosely translated):
My first thought was that the fact that I was running a x64 version of Node was the problem, so I decided to try the packaging command using
So, my last attempt was to install a x86 version of Node and rerun all the steps. Unfortunately, that still gave me the same error as the x64 version. Either way, at least I got the unpackaged version to work. |
@rmobis Oh sorry, you are right, it's |
@iiegor Indeed, moving the |
@iiegor Just wondering - isn't your instruction listing above to get it build on windows related to git bash or some other unix shell windows env? IMHO |
@jerch Yes, MINGW32. For native shell run |
@iiegor I would like to contribute to the project, but I refuse to install Visual Studio 2013. I know this is not a fault in black-screen, but rather node-gyp or Micro$oft's redists. I'll never use VS13 or any VS for that matter, so I find this unnecessary. I've never had this issue before either, when rebuilding npm packages on Windows. Anyway, I think I'm switching back to Linux in a moment anyway, so this won't be much of an issue for me. |
No description provided.