Skip to content
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

Non-Windows environments should try to run the PowerShell script #96

Open
hugodahl opened this issue Feb 8, 2019 · 4 comments
Open

Comments

@hugodahl
Copy link
Contributor

hugodahl commented Feb 8, 2019

Is your feature request related to a problem? Please describe.
To help reduce duplication of effort, when launching the post-build event on non-Windows environments, we should check to see if PowerShell Core is installed. If it is, we should call pwsh with the RegisterPluginAndStartStreamDeck.ps1 as it will likely have the most current and up-to-date changes before the shell script (RegisterPluginAndStartStreamDeck.sh) will

Describe the solution you'd like
From the RegisterPluginAndStartStreamDeck.sh script, check for the presence of PowerShell Core. There are myriad ways of doing this, but we should strive to make sure that the method used is compatible with a base Bash shell, that is, /bin/sh.

Describe alternatives you've considered
Within the community, we've tried to keep parity between the PowerShell and Shell scripts, however, there is a lot more experience and comfort writing PowerShell than Shell scripts.

Additional context
None

Is there one or more bugs reported related to this suggestion? If so, mention them below
none

@NotMyself
Copy link

I am not sure this is the right path to take. On windows, you can be fairly certain that powershell is available. On, not windows you can be fairly certain that bash is available. There is a tiny number of powershell core installs by comparison.

So, we would be writing logic that we have to maintain forever, to support a small number of people who happen to have powershell on non-windows OSes. Given our audience, that might be a larger number than the average, but I still think it is minimal value for the effort.

just my 💵💵 <-- closest thing to $0.02 I could find.

@hugodahl
Copy link
Contributor Author

hugodahl commented Feb 8, 2019

I am not sure this is the right path to take. On windows, you can be fairly certain that powershell is available. On, not windows you can be fairly certain that bash is available. There is a tiny number of powershell core installs by comparison.

So, we would be writing logic that we have to maintain forever, to support a small number of people who happen to have powershell on non-windows OSes. Given our audience, that might be a larger number than the average, but I still think it is minimal value for the effort.

just my 💵💵 <-- closest thing to $0.02 I could find.

That's a good point. I was thinking of something incredibly basic. Either calling pwsh -c "exit 0;" (or close to it) and make sure we get a 0 return code. I've also come across built-in shell commands, like command <file> or hash <file> to see if a file or application is in your $PATH environment variable.

If it is, call PowerShell with the .ps1 file and return its exit code, otherwise, run the rest of the script as it is today.

@NotMyself
Copy link

What about environment specific things like the elgato plugin install location?

@hugodahl
Copy link
Contributor Author

hugodahl commented Feb 8, 2019

What about environment specific things like the Elgato plugin install location?

In the stream on Thursday Feb 7th, 2019 (linking for posterity and SEO-fu), there was work done with Tyler, which isn't merged yet, that added considerations for scenarios specific to the environment and platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants