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

Is a relative path prefix needed for Command? #8

Closed
calebwherry opened this issue Oct 10, 2021 · 2 comments
Closed

Is a relative path prefix needed for Command? #8

calebwherry opened this issue Oct 10, 2021 · 2 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@calebwherry
Copy link
Collaborator

Does just using the exe name work instead of having to join with the full path?

Originally posted by @calebwherry in #1 (comment)

@robertdfrench robertdfrench self-assigned this Oct 10, 2021
@robertdfrench
Copy link
Owner

In e187ac1 you showed that we can just write Path::new("./target/debug/whatever") and it will still work on Windows. But to answer this question completely, I removed the leading ./ and all the tests still passed:

     #[test]
     fn query_version_info() {
-        let path = Path::new("./target/debug/fake_git");
+        let path = Path::new("target/debug/fake_git");
         let fake_git = Git::with_path(path);
         let version = fake_git.version().unwrap();
         assert!(version.starts_with("fake_git version 1"));

So you are right; we do not need the relative prefix here. I am inclined to say we leave it anyhow, since it's a little more explicit and Windows seems to tolerate it. But if you want to drop it, I'm not opposed.

@calebwherry
Copy link
Collaborator Author

I'm fine with leaving it, I think it makes it more clear on the intention of running from the PWD.

@calebwherry calebwherry added the wontfix This will not be worked on label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants