From f5af373696507f286090ce21a127480f6b150c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Tue, 25 Jan 2022 11:50:35 +0100 Subject: [PATCH] Win: RS quick link Not RD, because that is a powershell command. --- src/help-windows.in | 8 ++++---- src/windows.rs | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/help-windows.in b/src/help-windows.in index 9eb4805..cf162bd 100644 --- a/src/help-windows.in +++ b/src/help-windows.in @@ -50,7 +50,7 @@ const HELP_RESOLVE_EXAMPLES: &str = r#"EXAMPLES: const HELP_DEFAULT: &str = r#" DESCRIPTION Print or set the default R version. The default R version is the one - that can be started with the `R` and `RD` commands, via quick + that can be started with the `R` and `RS` commands, via quick batch files at `C:\Program Files\R\bin`. Call without any arguments to see the current default. Call with the @@ -65,10 +65,10 @@ DESCRIPTION KNOWN ISSUES: - If you don't call `rim system default ` to set the default R - version then there is no default, and there are no `R` and `RD` + version then there is no default, and there are no `R` and `RS` commands. - If you delete the default R version with `rim rm` or another way, - then the `R` and `RD` commands will kept, but they will point to a + then the `R` and `RS` commands will kept, but they will point to a non-existing directory and fail. "#; @@ -167,7 +167,7 @@ DESCRIPTION installations. This lets you directly run a specific R version. E.g. `R-4.1.2` will start R 4.1.2. - It also adds an `R` and `RD` link that runs the default R version. + It also adds an `R` and `RS` link that runs the default R version. See `rim default`. `rim add` runs `rim system make-links`, so if you only use rim to diff --git a/src/windows.rs b/src/windows.rs index 4b82bdd..3f83c8c 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -351,6 +351,10 @@ pub fn sc_set_default(ver: String) { "@\"C:\\Program Files\\R\\R-" + &ver + "\\bin\\R\" %*\n"; let mut file = File::create(linkfile).unwrap(); file.write_all(cnt.as_bytes()).unwrap(); + + let linkfile2 = base.join("bin").join("RS.bat"); + let mut file2 = File::create(linkfile2).unwrap(); + file2.write_all(cnt.as_bytes()).unwrap(); } pub fn sc_get_default() -> String {