File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 22import tempfile
33import subprocess
44import getpass
5+ import shutil
56from textwrap import dedent
67
78def setup_shiny ():
@@ -56,16 +57,25 @@ def _get_rsession_env(port):
5657 'RSTUDIO_DEFAULT_R_VERSION' : version ,
5758 }
5859
59- return {
60- 'command' : [
61- 'rsession' ,
60+ def _get_rsession_cmd (port ):
61+ if shutil .which ('rsession' ):
62+ executable = 'rsession'
63+ else :
64+ # Default path for rsession if installed with the deb package
65+ executable = '/usr/lib/rstudio-server/bin/rsession'
66+
67+ return [
68+ executable ,
6269 '--standalone=1' ,
6370 '--program-mode=server' ,
6471 '--log-stderr=1' ,
6572 '--session-timeout-minutes=0' ,
6673 '--user-identity=' + getpass .getuser (),
67- '--www-port={port}'
68- ],
74+ '--www-port=' + str (port )
75+ ]
76+
77+ return {
78+ 'command' : _get_rsession_cmd ,
6979 'environment' : _get_rsession_env ,
7080 'title' : 'RStudio' ,
7181 'icon' : os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'icons' , 'rstudio.svg' )
You can’t perform that action at this time.
0 commit comments