Skip to content

Commit

Permalink
use cached compose filename
Browse files Browse the repository at this point in the history
  • Loading branch information
kla committed Sep 22, 2024
1 parent b417a23 commit 0950778
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class Container {
}

get composeFile(): string {
return this._composeFile ||= new Staxfile({ context: this.context, source: this.source, staxfile: this.staxfile, app: this.app }).compile()
return this._composeFile ||= new Staxfile({ context: this.context, source: this.source, staxfile: this.staxfile, app: this.app }).cachedComposeFile
}

get forwardedPorts(): string[] {
Expand Down
6 changes: 5 additions & 1 deletion src/staxfile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ export default class Staxfile {
return cacheDir
}

public get cachedComposeFile(): string | null {
return path.join(this.cacheDir, 'compose.yaml')
}

public compile(force: boolean = false): string {
const composeFile = path.join(this.cacheDir, 'compose.yaml')
const composeFile = this.cachedComposeFile

if (!force && existsSync(composeFile)) {
const cachedStats = statSync(composeFile)
Expand Down

0 comments on commit 0950778

Please sign in to comment.