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

Fix for windows #1812

Closed
wants to merge 7 commits into from
Closed

Fix for windows #1812

wants to merge 7 commits into from

Conversation

kono
Copy link

@kono kono commented Jul 17, 2023

sh> operator of v0.10.0 on Windows platform and compatibility

When specifying "powershell" for shell in a .dig file, the "powershell.exe" was
specified as ["powershell.exe","-"] until digdag ver. 0.9.x.
Since ver. 0.10 the "-" is no longer necessary.

However, for compatibility, the specification ["powershell.exe","-"]
should be read as ["powershell.exe"].

[WIP] Fix sh> operator issue on Windows #1654 is also included.

kono added 6 commits May 5, 2023 09:25
- In Windows environment, set the extension of the executable script to
  .ps1.
- When specifying "powershell" for shell in a .dig file, the
  specification ["powershell.exe","-"] was used until digdag ver. 0.9.x.
  Since ver. 0.10, the "-" is no longer necessary.
  However, to ensure compatibility, the specification ["powershell.exe","-"]
  should be read as ["powershell.exe"].
@kono kono marked this pull request as ready for review July 17, 2023 09:02
@yoyama yoyama added this to the v0.10.6 milestone Aug 17, 2023
@yoyama yoyama requested a review from szyn September 15, 2023 07:33
@yoyama
Copy link
Contributor

yoyama commented Sep 15, 2023

I am wondering whether rewriting the task definiton of sh> operator is good way or not.
In addition the logic to check condition to rewrite is not solid.

List<String> temp_shell;
if (params.has("shell")) {
temp_shell = params.getListOrEmpty("shell", String.class);
if (temp_shell.get(0).toLowerCase().contains("powershell") && temp_shell.size() == 2){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contains("powershell") will match to strings like 'powershell-batch.bat`. Is it intentional ?

if (params.has("shell")) {
temp_shell = params.getListOrEmpty("shell", String.class);
if (temp_shell.get(0).toLowerCase().contains("powershell") && temp_shell.size() == 2){
if (temp_shell.get(1).contains("-")){
Copy link
Contributor

@yoyama yoyama Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. It will match like -option or abc-def.txt.

@kono
Copy link
Author

kono commented Sep 18, 2023

@yoyama , thank you for your review.
Changed to check more solidly.

@kono kono closed this Feb 24, 2024
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

Successfully merging this pull request may close these issues.

2 participants