-
Notifications
You must be signed in to change notification settings - Fork 66
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
Call yarn as "yarn.cmd" on Windows (fixes #53) #65
Conversation
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.
@lynn thanks a bundle for this! The latest commit in main
now uses tsync as a library instead of expecting a globally-installed tsync binary. How does that affect these changes?
name = "fullstack" | ||
path = ".cargo/bin/fullstack.rs" | ||
name = "run_yarn_fullstack" | ||
path = ".cargo/bin/run_yarn_fullstack.rs" |
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.
is this rename necessary or were you trying to maintain the naming convention with tsync?
if it's not necessary, let's undo this change.
name = "tsync" | ||
path = ".cargo/bin/tsync.rs" | ||
name = "run_yarn_tsync" | ||
path = ".cargo/bin/run_yarn_tsync.rs" |
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.
8.1.0 doesn't run tsync via yarn anymore nor does it use the global tsync binary.
Since you can uninstall tsync via cargo uninstall tsync
and use cargo tsync
normally, do you think this resolves the issue?
#[cfg(windows)] | ||
pub const YARN_COMMAND: &'static str = "yarn.cmd"; | ||
|
||
#[cfg(not(windows))] | ||
pub const YARN_COMMAND: &'static str = "yarn"; |
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.
🎉
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.
perfect!~
#[cfg(windows)] | ||
pub const YARN_COMMAND: &'static str = "yarn.cmd"; | ||
|
||
#[cfg(not(windows))] | ||
pub const YARN_COMMAND: &'static str = "yarn"; | ||
|
||
pub fn main() -> Result<(), io::Error> { | ||
let dir = env!("CARGO_MANIFEST_DIR"); | ||
|
||
println!("Running `yarn tsync` in `$project_dir/frontend/`..."); | ||
|
||
Command::new("yarn") | ||
Command::new(YARN_COMMAND) |
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.
if you rebase, these changes won't be necessary :)
Also rename the binaries that call
yarn
so that there are not two clashing binaries namedtsync.exe
(see #53 (comment)).