Move to Traefik
This commit is contained in:
parent
bf57c0d5a6
commit
471ccbadc5
36 changed files with 200 additions and 190 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package fsx
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
|
|
@ -11,11 +12,14 @@ import (
|
|||
//
|
||||
// If the file does not exist exists, it is created using [env.Create].
|
||||
// If the file does exist, it's access and modification times are updated to the current time.
|
||||
func Touch(env environment.Environment, path string) error {
|
||||
func Touch(env environment.Environment, path string, perm fs.FileMode) error {
|
||||
if perm == 0 {
|
||||
perm = environment.DefaultFilePerm
|
||||
}
|
||||
_, err := env.Stat(path)
|
||||
switch {
|
||||
case environment.IsNotExist(err):
|
||||
f, err := env.Create(path, environment.DefaultFilePerm)
|
||||
f, err := env.Create(path, perm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ parseloop:
|
|||
// Check if there were missing template keys.
|
||||
// If so, we sort them and return an appropriate error.
|
||||
if len(missingKeys) != 0 {
|
||||
keys := maps.Keys(unusedKeys)
|
||||
keys := maps.Keys(missingKeys)
|
||||
slices.Sort(keys)
|
||||
return MissingTemplateKeyError{
|
||||
Keys: keys,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue