Skip to content

Commit

Permalink
go/runtime/bundle: Explode all bundles in the same folder
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Jan 16, 2025
1 parent 12f5f2f commit 1e16909
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions go/runtime/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,32 +401,9 @@ func ExplodedPath(dataDir string) string {
return filepath.Join(dataDir, "runtimes", "bundles")
}

// DetachedExplodedPath returns the path under the data directory that contains all of the detached
// exploded bundles.
func DetachedExplodedPath(dataDir string) string {
return filepath.Join(ExplodedPath(dataDir), "detached")
}

// ExplodedPath returns the path that the corresponding asset will be written to via WriteExploded.
func (bnd *Bundle) ExplodedPath(dataDir, fn string) string {
var subDir string
switch bnd.Manifest.IsDetached() {
case false:
// DATADIR/runtimes/bundles/manifestHash
subDir = filepath.Join(ExplodedPath(dataDir),
bnd.manifestHash.String(),
)
case true:
// DATADIR/runtimes/bundles/detached/manifestHash
subDir = filepath.Join(DetachedExplodedPath(dataDir),
bnd.manifestHash.String(),
)
}

if fn == "" {
return subDir
}
return filepath.Join(subDir, fn)
return filepath.Join(ExplodedPath(dataDir), bnd.manifestHash.String(), fn)
}

// WriteExploded extracts the runtime bundle, writes it to the appropriate
Expand Down

0 comments on commit 1e16909

Please sign in to comment.