File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ def db_config():
6969 f .close ()
7070 return db_dir , db_config_name
7171
72+ def _support_arg (arg ):
73+ ret = subprocess .check_output ([get_rstudio_executable ('rserver' ), '--help' ])
74+ return ret .decode ().find (arg ) != - 1
75+
7276 def _get_cmd (port ):
7377 ntf = tempfile .NamedTemporaryFile ()
7478 db_dir , db_cfg = db_config ()
@@ -80,10 +84,15 @@ def _get_cmd(port):
8084 '--www-verify-user-agent=0' ,
8185 '--secure-cookie-key-file=' + ntf .name ,
8286 '--server-user=' + getpass .getuser (),
83- '--www-root-path={base_url}rstudio/' ,
84- f'--server-data-dir={ db_dir } ' ,
85- f'--database-config-file={ db_cfg } '
8687 ]
88+ # Support at least v1.2.1335 and up
89+
90+ if _support_arg ('www-root-path' ):
91+ cmd .append ('--www-root-path={base_url}rstudio/' )
92+ if _support_arg ('server-data-dir' ):
93+ cmd .append (f'--server-data-dir={ db_dir } ' )
94+ if _support_arg ('database-config-file' ):
95+ cmd .append (f'--database-config-file={ db_cfg } ' )
8796
8897 return cmd
8998
You can’t perform that action at this time.
0 commit comments