Skip to content

Commit

Permalink
Merge pull request #172 from sol-eng/remove-old-jupyter
Browse files Browse the repository at this point in the history
Ensure default commented out jupyter line is removed
  • Loading branch information
tnederlof authored May 19, 2023
2 parents b8e1906 + f1c0dd3 commit 172e07f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/workbench/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,18 @@ func WriteConnectURLConfig(url string) error {

// WriteJupyterConfig writes the Jupyter config to the Workbench config file
func WriteJupyterConfig(jupyterPath string) error {
// TODO check to ensure line doesn't already exist and ideally take out the default commented out line to reduce confusion
// remove the existing line
filepath := "/etc/rstudio/jupyter.conf"
err := system.DeleteStrings([]string{"# jupyter-exe=/usr/local/bin/jupyter"}, filepath, 0644)
if err != nil {
return fmt.Errorf("failed to delete the old jupyter-exe=: %w", err)
}

writeLines := []string{
"jupyter-exe=" + jupyterPath,
}
filepath := "/etc/rstudio/jupyter.conf"

err := system.WriteStrings(writeLines, filepath, 0644, true)
err = system.WriteStrings(writeLines, filepath, 0644, true)
if err != nil {
return fmt.Errorf("failed to write config: %w", err)
}
Expand Down

0 comments on commit 172e07f

Please sign in to comment.