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

Program not working under Windows #5

Closed
Hoffenbar opened this issue Jan 25, 2023 · 4 comments
Closed

Program not working under Windows #5

Hoffenbar opened this issue Jan 25, 2023 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Hoffenbar
Copy link

I've tested several variations, e.g.

<!-- cmdrun tclkitsh test1.tcl -->

<!-- cmdrun cmd /cecho abcd -->

but no output is produced. Maybe because you call sh instead of env(COMSPEC)?

FauconFan added a commit that referenced this issue Jan 30, 2023
@FauconFan FauconFan added the help wanted Extra attention is needed label Jan 30, 2023
@FauconFan
Copy link
Owner

Hi!
I am not familiar enough with the Windows OS shells, so I don't know how to fix this... (I also don't have the time).
I mark this as Help Wanted and let you (or anyone who feel confident) to solve this.
It would be nice to have to replicate the test pipeline in Windows as well. (If you (or someone) wants to hotfix this without replicating the pipeline, I'll open another issue)

@Hoffenbar
Copy link
Author

Unfortunally, I'm not a rust-guy, so I could not solve this by myself..... Thank you for your response!

@elidhu
Copy link

elidhu commented Feb 3, 2023

I think this would help:

https://doc.rust-lang.org/std/process/struct.Command.html

Particularly

use std::process::Command;

let output = if cfg!(target_os = "windows") {
    Command::new("cmd")
            .args(["/C", "echo hello"])
            .output()
            .expect("failed to execute process")
} else {
    Command::new("sh")
            .arg("-c")
            .arg("echo hello")
            .output()
            .expect("failed to execute process")
};

let hello = output.stdout;

@FauconFan
Copy link
Owner

This has been resolved by @exsjabe in #10. Thanks to him!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants