From 11fc1e8588a0d63db0296e46b8dd5d1e8e4ef3a1 Mon Sep 17 00:00:00 2001 From: zongz <68977949+zong-zhe@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:08:31 +0800 Subject: [PATCH] fix: fix missing echo in kcl run (#184) --- pkg/fs/util.go | 2 +- pkg/options/run.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/fs/util.go b/pkg/fs/util.go index bdd4fc7..b95a838 100644 --- a/pkg/fs/util.go +++ b/pkg/fs/util.go @@ -8,7 +8,7 @@ import ( ) func GenTempFileFromStdin() (string, error) { - tempFile, err := os.CreateTemp("", "stdin") + tempFile, err := os.CreateTemp("", "stdin-*.k") if err != nil { return "", err } diff --git a/pkg/options/run.go b/pkg/options/run.go index b5f9138..edfdc6a 100644 --- a/pkg/options/run.go +++ b/pkg/options/run.go @@ -207,6 +207,10 @@ func (o *RunOptions) Complete(args []string) error { } for _, arg := range args { + if arg == "-" { + o.Entries = append(o.Entries, arg) + continue + } modSpec := downloader.ModSpec{} err := modSpec.FromString(arg)