@@ -15,6 +15,7 @@ import {
1515
1616import { basename , dirname , join } from "../../deno_ral/path.ts" ;
1717import { existsSync } from "../../deno_ral/fs.ts" ;
18+ import { isMac , isWindows } from "../../deno_ral/platform.ts" ;
1819
1920export interface Editor {
2021 // A short, command line friendly id
@@ -104,7 +105,7 @@ function vscodeEditorInfo(): EditorInfo {
104105 actions : [ ] ,
105106 } ;
106107
107- if ( Deno . build . os === "windows" ) {
108+ if ( isWindows ) {
108109 editorInfo . actions . push ( {
109110 action : "which" ,
110111 arg : "code.exe" ,
@@ -118,7 +119,7 @@ function vscodeEditorInfo(): EditorInfo {
118119 } ,
119120 ) ;
120121 editorInfo . actions . push ( ...pathActions ) ;
121- } else if ( Deno . build . os === "darwin" ) {
122+ } else if ( isMac ) {
122123 editorInfo . actions . push ( {
123124 action : "which" ,
124125 arg : "code" ,
@@ -168,7 +169,7 @@ function positronEditorInfo(): EditorInfo {
168169 actions : [ ] ,
169170 } ;
170171
171- if ( Deno . build . os === "windows" ) {
172+ if ( isWindows ) {
172173 editorInfo . actions . push ( {
173174 action : "which" ,
174175 arg : "Positron.exe" ,
@@ -182,7 +183,7 @@ function positronEditorInfo(): EditorInfo {
182183 } ,
183184 ) ;
184185 editorInfo . actions . push ( ...pathActions ) ;
185- } else if ( Deno . build . os === "darwin" ) {
186+ } else if ( isMac ) {
186187 editorInfo . actions . push ( {
187188 action : "which" ,
188189 arg : "positron" ,
@@ -223,7 +224,7 @@ function rstudioEditorInfo(): EditorInfo {
223224 const rProjPath = join ( cwd , `${ artifactName } .Rproj` ) ;
224225 Deno . writeTextFileSync ( rProjPath , kRProjContents ) ;
225226
226- const cmd = path . endsWith ( ".app" ) && Deno . build . os === "darwin"
227+ const cmd = path . endsWith ( ".app" ) && isMac
227228 ? [ "open" , "-na" , path , "--args" , rProjPath ]
228229 : [ path , rProjPath ] ;
229230
@@ -239,7 +240,7 @@ function rstudioEditorInfo(): EditorInfo {
239240 } ;
240241
241242 const rstudioExe = "rstudio.exe" ;
242- if ( Deno . build . os === "windows" ) {
243+ if ( isWindows ) {
243244 editorInfo . actions . push ( {
244245 action : "env" ,
245246 arg : "RS_RPOSTBACK_PATH" ,
@@ -257,7 +258,7 @@ function rstudioEditorInfo(): EditorInfo {
257258 } ,
258259 ) ;
259260 editorInfo . actions . push ( ...paths ) ;
260- } else if ( Deno . build . os === "darwin" ) {
261+ } else if ( isMac ) {
261262 const paths = macosAppPaths ( "RStudio.app" ) . map ( ( path ) => {
262263 return {
263264 action : "path" ,
0 commit comments