Skip to content

Commit

Permalink
Win: RS quick link
Browse files Browse the repository at this point in the history
Not RD, because that is a powershell command.
  • Loading branch information
gaborcsardi committed Jan 25, 2022
1 parent 9b6f71d commit f5af373
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/help-windows.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -65,10 +65,10 @@ DESCRIPTION
KNOWN ISSUES:
- If you don't call `rim system default <ver>` 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.
"#;

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f5af373

Please sign in to comment.