Skip to content

Commit 4bf7716

Browse files
committed
args
1 parent 176644f commit 4bf7716

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/staxfile/compiler.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export default class Compiler {
8383
})
8484
}
8585

86-
private envVarComments(): string {
87-
return Object.entries(this.data.build.args).map(([name, value]) => `# ${name}=${value}\n`).join('')
86+
private args(): string {
87+
return Object.entries(this.data.build.args).map(([name, value]) => `ARG ${name}="${value}"\n`).join('')
8888
}
8989

9090
private parseBase(file: string, includes: Record<string, string>) {
91-
let text = this.envVarComments()
91+
let text = ""
9292

9393
if (!fileExists(file))
9494
exit(1, `File not found: ${file}`)
@@ -101,7 +101,10 @@ export default class Compiler {
101101
else
102102
text += line + "\n"
103103
})
104-
return this.substituteVariables(text)
104+
105+
text = this.substituteVariables(text)
106+
text = text.replaceAll('# $stax.section args', this.args())
107+
return text
105108
}
106109

107110
private substituteVariables(dockerfile: string): string {

0 commit comments

Comments
 (0)