summaryrefslogtreecommitdiff
path: root/internal/commands/util.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2022-10-17 21:51:59 +1100
committerGitHub <noreply@github.com>2022-10-17 21:51:59 +1100
commit3a70f6739b82a523fc8112a29ac156446253fc58 (patch)
tree9a888643c24bd3888f9fa49a11f1a61000cd0c38 /internal/commands/util.go
parent8eadf72dc776aa75cdb7337f7d54dff50cbf14ec (diff)
feat(authentication): file password algorithms (#3848)
This adds significant enhancements to the file auth provider including multiple additional algorithms.
Diffstat (limited to 'internal/commands/util.go')
-rw-r--r--internal/commands/util.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/commands/util.go b/internal/commands/util.go
index ef83e1627..96043bfba 100644
--- a/internal/commands/util.go
+++ b/internal/commands/util.go
@@ -2,6 +2,7 @@ package commands
import (
"fmt"
+ "os"
)
func recoverErr(i any) error {
@@ -16,3 +17,15 @@ func recoverErr(i any) error {
return fmt.Errorf("recovered panic with unknown type: %v", v)
}
}
+
+func configFilterExisting(configs []string) (finalConfigs []string) {
+ var err error
+
+ for _, c := range configs {
+ if _, err = os.Stat(c); err == nil || !os.IsNotExist(err) {
+ finalConfigs = append(finalConfigs, c)
+ }
+ }
+
+ return finalConfigs
+}