Skip to content

Commit

Permalink
Merge pull request #173 from sol-eng/fix-merge-issues
Browse files Browse the repository at this point in the history
Fix merge issue related to writestrings
  • Loading branch information
tnederlof authored Jun 7, 2023
2 parents 0cc97e5 + e78d960 commit 1ca256f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/quarto/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func ScanForBundledQuartoVersion() (string, error) {
quartoPath := "/usr/lib/rstudio-server/bin/quarto/bin/quarto"
versionCommand := quartoPath + " --version"
quartoVersion, err := system.RunCommandAndCaptureOutput(versionCommand, false, 0)
quartoVersion, err := system.RunCommandAndCaptureOutput(versionCommand, false, 0, false)
if err != nil {
return "", fmt.Errorf("issue finding Quarto version: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/quarto/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func installQuarto(filepath string, osType config.OperatingSystem, version strin

installCommand := fmt.Sprintf(`tar -zxvf "%s" -C "%s" --strip-components=1`, filepath, path)

err := system.RunCommand(installCommand, false, 0)
err := system.RunCommand(installCommand, false, 0, true)
if err != nil {
return fmt.Errorf("the command '%s' failed to run: %w", installCommand, err)
}
Expand Down Expand Up @@ -155,7 +155,7 @@ func promptAndSetQuartoSymlink(quartoPaths []string) error {
// setQuartoSymlinks sets the Quarto symlink
func setQuartoSymlinks(quartoPath string, display bool) error {
quartoCommand := "ln -s " + quartoPath + " /usr/local/bin/quarto"
err := system.RunCommand(quartoCommand, display, 0)
err := system.RunCommand(quartoCommand, display, 0, true)
if err != nil {
return fmt.Errorf("error setting Quarto symlink with the command '%s': %w", quartoCommand, err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/ssl/trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TrustRootCertificate(rootCA *x509.Certificate, osType config.OperatingSyste
pemCert = append(pemCert, string(pem.EncodeToMemory(&block)))
switch osType {
case config.Ubuntu18, config.Ubuntu20, config.Ubuntu22:
err := system.WriteStrings(pemCert, "/usr/local/share/ca-certificates/workbenchCA.crt", 0755, true)
err := system.WriteStrings(pemCert, "/usr/local/share/ca-certificates/workbenchCA.crt", 0755, true, true)
if err != nil {
return fmt.Errorf("writing certificate to disk failed: %w", err)
}
Expand All @@ -24,7 +24,7 @@ func TrustRootCertificate(rootCA *x509.Certificate, osType config.OperatingSyste
return fmt.Errorf("running command to trust root certificate: %w", err)
}
case config.Redhat7, config.Redhat8, config.Redhat9:
err := system.WriteStrings(pemCert, "/etc/pki/ca-trust/source/anchors/workbenchCA.crt", 0755, true)
err := system.WriteStrings(pemCert, "/etc/pki/ca-trust/source/anchors/workbenchCA.crt", 0755, true, true)
if err != nil {
return fmt.Errorf("writing CA certificate to disk failed: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/system/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "fmt"
// AddToPATH adds a path to the PATH environment variable in a profile.d script
func AddToPATH(path string, filename string) error {
fullFileName := "/etc/profile.d/wbi_" + filename + ".sh"
err := WriteStrings([]string{"PATH=" + path + ":$PATH"}, fullFileName, 0644, true)
err := WriteStrings([]string{"PATH=" + path + ":$PATH"}, fullFileName, 0644, true, true)
if err != nil {
return fmt.Errorf("failed to add to PATH: %w", err)
}
Expand Down
10 changes: 5 additions & 5 deletions internal/workbench/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func WriteRepoConfig(url string, source string) error {
"CRAN=" + url,
}

err := system.WriteStrings(writeLines, filepath, 0644, true)
err := system.WriteStrings(writeLines, filepath, 0644, true, true)
if err != nil {
return fmt.Errorf("failed to write config: %w", err)
}
Expand All @@ -42,7 +42,7 @@ func WriteRepoConfig(url string, source string) error {
"index-url=" + url,
}

err = system.WriteStrings(writeLines, filepath, 0644, true)
err = system.WriteStrings(writeLines, filepath, 0644, true, true)
if err != nil {
return fmt.Errorf("failed to write config: %w", err)
}
Expand Down Expand Up @@ -107,7 +107,7 @@ func WriteSSLConfig(certPath string, keyPath string, serverURL string) error {
"ssl-certificate-key=" + keyPath,
}

err = system.WriteStrings(writeLines, filepath, 0644, true)
err = system.WriteStrings(writeLines, filepath, 0644, true, true)
if err != nil {
return fmt.Errorf("failed to write config: %w", err)
}
Expand All @@ -132,7 +132,7 @@ func WriteConnectURLConfig(url string) error {
"default-rsconnect-server=" + url,
}

err = system.WriteStrings(writeLines, filepath, 0644, true)
err = system.WriteStrings(writeLines, filepath, 0644, true, true)
if err != nil {
return fmt.Errorf("failed to write config: %w", err)
}
Expand All @@ -155,7 +155,7 @@ func WriteJupyterConfig(jupyterPath string) error {
"jupyter-exe=" + jupyterPath,
}

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

0 comments on commit 1ca256f

Please sign in to comment.