-
-
Notifications
You must be signed in to change notification settings - Fork 35
Fix: Update remote system detection command for Windows compatibility #201
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ func (p *Plugin) removeAllDestFile() error { | |
}, | ||
} | ||
|
||
_, _, _, err := ssh.Run("ver", p.Config.CommandTimeout) | ||
_, _, _, err := ssh.Run("cmd /c ver 2>$null", p.Config.CommandTimeout) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command string For example, you could add: const WindowsDetectCmd = "cmd /c ver 2>$null" Then, you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Execute Windows version command through CMD explicitly |
||
systemType := "unix" | ||
if err == nil { | ||
systemType = "windows" | ||
|
@@ -292,7 +292,7 @@ func (p *Plugin) Exec() error { | |
} | ||
|
||
systemType := "unix" | ||
_, _, _, err := ssh.Run("ver", p.Config.CommandTimeout) | ||
_, _, _, err := ssh.Run("cmd /c ver 2>$null", p.Config.CommandTimeout) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if err == nil { | ||
systemType = "windows" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -571,7 +571,7 @@ func TestRemoveDestFile(t *testing.T) { | |
DestFile: "/etc/resolv.conf", | ||
} | ||
|
||
_, _, _, err := ssh.Run("ver", plugin.Config.CommandTimeout) | ||
_, _, _, err := ssh.Run("cmd /c ver 2>$null", plugin.Config.CommandTimeout) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
systemType := "unix" | ||
if err == nil { | ||
systemType = "windows" | ||
|
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.
fix: resolve compilation error in path_windows_test.go
Fixed test case structure where string was passed directly instead of
being wrapped in args struct, which caused build failure.