refactor: allow setting a custom mode when writing a slice to a file

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-18 19:11:53 -05:00
parent d4da8aea84
commit fb73474675
4 changed files with 46 additions and 20 deletions

View File

@@ -32,5 +32,9 @@ func touchPhaseFile(appName string, phase string) error {
func writeDockerOptionsForPhase(appName string, phase string, options []string) error {
phaseFilePath := getPhaseFilePath(appName, phase)
return common.WriteSliceToFile(phaseFilePath, options)
return common.WriteSliceToFile(common.WriteSliceToFileInput{
Filename: phaseFilePath,
Lines: options,
Mode: os.FileMode(0600),
})
}