Skip to content

Commit e9e2803

Browse files
committed
fix: git repo running
Signed-off-by: peefy <[email protected]>
1 parent b7d5d2e commit e9e2803

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: cmd/kcl/commands/run.go

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k
2424
# Run OCI packages
2525
kcl run oci://ghcr.io/kcl-lang/hello-world
2626
27+
# Run remote Git repo
28+
kcl run https://github.com/kcl-lang/flask-demo-kcl-manifests
29+
2730
# Run the current package
2831
kcl run`
2932
)

Diff for: pkg/options/run.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,16 @@ func (o *RunOptions) Run() error {
152152
}
153153
result, err = cli.CompileWithOpts(opts)
154154
} else if entry.IsTar() {
155-
// kcl compiles the package from the kcl package tar.
155+
// compiles the package from the kcl package tar.
156156
opts.SetEntries([]string{})
157157
result, err = cli.CompileTarPkg(entry.PackageSource(), opts)
158158
} else if entry.IsGit() {
159+
opts.SetEntries([]string{})
159160
gitOpts := git.NewCloneOptions(entry.PackageSource(), "", o.Tag, "", "", nil)
160-
// 'kpm run' compile the package from the git url
161+
// compiles the package from the git url
161162
result, err = cli.CompileGitPkg(gitOpts, opts)
162163
} else if entry.IsUrl() {
163-
// kcl compiles the package from the OCI reference or url.
164+
// compiles the package from the OCI reference or url.
164165
opts.SetEntries([]string{})
165166
result, err = cli.CompileOciPkg(entry.PackageSource(), o.Tag, opts)
166167
} else {

0 commit comments

Comments
 (0)