kcl-lang / kcl-lang.io

KCL Website and Documentation Repo: https://kcl-lang.io
https://kcl-lang.github.io
Apache License 2.0
13 stars 35 forks source link

[FAQ] best approach to decide a kcl file/path to include #301

Closed wilsonwang371 closed 6 months ago

wilsonwang371 commented 6 months ago

General Question

What is the best approach to use a runtime variable to decide which file in a directory to include?

For example, I have dev.k prod.k in a directory. I want to include one of them when run kcl build. What is the best approach to do this? The dev.k is for dev environment and prod.k is for production environment.

Peefy commented 6 months ago

Thank you for your question.

I think there are two ways to use it here:

However, my personal suggestion is to choose the former as the best practice for tools such as Helm and Kustomize in GitOps.