Skip to content

Commit

Permalink
fix: fix runtime arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed May 22, 2024
1 parent 4d58946 commit 0ffda7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions cmd/new-dockerfile/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package main
import (
"errors"
"fmt"
"github.com/spf13/viper"
"log/slog"
"os"
"path/filepath"
"strings"
"time"

"github.com/spf13/viper"

dockerfile "github.com/flexstack/new-dockerfile"
"github.com/flexstack/new-dockerfile/runtime"
"github.com/lmittmann/tint"
Expand Down Expand Up @@ -49,17 +50,25 @@ func main() {
viper.SetConfigType("yaml")
viper.SetConfigType("yml")
viper.AddConfigPath(".")
if err := viper.ReadInConfig(); err != nil && !errors.As(err, &viper.ConfigFileNotFoundError{}) {
log.Error("Fatal error: " + err.Error())
os.Exit(1)
configExists := true
if err := viper.ReadInConfig(); err != nil {
if !errors.As(err, &viper.ConfigFileNotFoundError{}) {
log.Error("Fatal error: " + err.Error())
os.Exit(1)
}

configExists = false
}

if configExists {
runtimeArg = viper.GetString("runtime")
}

var (
r runtime.Runtime
err error
)

runtimeArg = viper.GetString("runtime")
if runtimeArg != "" {
runtimes := df.ListRuntimes()

Expand Down
4 changes: 2 additions & 2 deletions node/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "new-dockerfile",
"version": "0.3.0",
"version": "0.3.1",
"config": {
"bin_version": "0.3.0"
"bin_version": "0.3.1"
},
"description": "Autogenerate Dockerfiles from your project source code",
"main": "index.js",
Expand Down

0 comments on commit 0ffda7b

Please sign in to comment.