File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ package main
3
3
import (
4
4
"errors"
5
5
"fmt"
6
- "github.com/spf13/viper"
7
6
"log/slog"
8
7
"os"
9
8
"path/filepath"
10
9
"strings"
11
10
"time"
12
11
12
+ "github.com/spf13/viper"
13
+
13
14
dockerfile "github.com/flexstack/new-dockerfile"
14
15
"github.com/flexstack/new-dockerfile/runtime"
15
16
"github.com/lmittmann/tint"
@@ -49,17 +50,25 @@ func main() {
49
50
viper .SetConfigType ("yaml" )
50
51
viper .SetConfigType ("yml" )
51
52
viper .AddConfigPath ("." )
52
- if err := viper .ReadInConfig (); err != nil && ! errors .As (err , & viper.ConfigFileNotFoundError {}) {
53
- log .Error ("Fatal error: " + err .Error ())
54
- os .Exit (1 )
53
+ configExists := true
54
+ if err := viper .ReadInConfig (); err != nil {
55
+ if ! errors .As (err , & viper.ConfigFileNotFoundError {}) {
56
+ log .Error ("Fatal error: " + err .Error ())
57
+ os .Exit (1 )
58
+ }
59
+
60
+ configExists = false
61
+ }
62
+
63
+ if configExists {
64
+ runtimeArg = viper .GetString ("runtime" )
55
65
}
56
66
57
67
var (
58
68
r runtime.Runtime
59
69
err error
60
70
)
61
71
62
- runtimeArg = viper .GetString ("runtime" )
63
72
if runtimeArg != "" {
64
73
runtimes := df .ListRuntimes ()
65
74
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " new-dockerfile" ,
3
- "version" : " 0.3.0 " ,
3
+ "version" : " 0.3.1 " ,
4
4
"config" : {
5
- "bin_version" : " 0.3.0 "
5
+ "bin_version" : " 0.3.1 "
6
6
},
7
7
"description" : " Autogenerate Dockerfiles from your project source code" ,
8
8
"main" : " index.js" ,
You can’t perform that action at this time.
0 commit comments