Skip to content

Commit

Permalink
sigh, run tests first maybe?
Browse files Browse the repository at this point in the history
Revert "assume target specifications are relative to release root"

This reverts commit d944b81.
  • Loading branch information
femnad committed Aug 24, 2024
1 parent d944b81 commit 41679b2
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions provision/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ type extractionFn func(ReleaseInfo, extractionHint) error
type ReleaseInfo struct {
execCandidate string
hasRootDir bool
absRoot string
absTarget string
relTarget string
targetOverride string
Expand Down Expand Up @@ -101,15 +100,6 @@ func downloadRelease(release entity.Release, s settings.Settings) (string, error
return downloadTempFile(response)
}

func releaseRoot(absTarget string) string {
dir, base := path.Split(absTarget)
if dir == "" {
return base
}

return releaseRoot(path.Clean(dir))
}

func processDownload(release entity.Release, s settings.Settings) (info ReleaseInfo, err error) {
tempFile, err := downloadRelease(release, s)
if err != nil {
Expand Down Expand Up @@ -150,13 +140,9 @@ func processDownload(release entity.Release, s settings.Settings) (info ReleaseI
}
}

// We need this because absTarget refers to the path where the release executable resides.
root := releaseRoot(info.relTarget)
absRoot := path.Join(dirName, root)

var chromeSandbox string
if release.ChromeSandbox != "" {
chromeSandbox = path.Join(absRoot, release.ChromeSandbox)
chromeSandbox = path.Join(absTarget, release.ChromeSandbox)
err = internal.EnsureFileAbsent(chromeSandbox)
if err != nil {
return info, fmt.Errorf("error removing chrome-sandbox file %s: %v", chromeSandbox, err)
Expand Down Expand Up @@ -190,7 +176,6 @@ func processDownload(release entity.Release, s settings.Settings) (info ReleaseI
}

info.absTarget = absTarget
info.absRoot = absRoot
return
}

Expand Down Expand Up @@ -751,7 +736,7 @@ func ensureRelease(release entity.Release, s settings.Settings) error {
return err
}

target := info.absRoot
target := info.absTarget
if info.targetOverride != "" {
target, _ = path.Split(target)
target = path.Join(target, info.targetOverride)
Expand Down

0 comments on commit 41679b2

Please sign in to comment.