mirror of
https://github.com/mudler/luet.git
synced 2025-09-17 07:42:25 +00:00
Add build --clean to CLI
This commit is contained in:
@@ -47,6 +47,7 @@ var buildCmd = &cobra.Command{
|
|||||||
},
|
},
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
|
clean := viper.GetBool("clean")
|
||||||
src := viper.GetString("tree")
|
src := viper.GetString("tree")
|
||||||
dst := viper.GetString("destination")
|
dst := viper.GetString("destination")
|
||||||
concurrency := viper.GetInt("concurrency")
|
concurrency := viper.GetInt("concurrency")
|
||||||
@@ -90,7 +91,9 @@ var buildCmd = &cobra.Command{
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
Fatal("Error: " + err.Error())
|
Fatal("Error: " + err.Error())
|
||||||
}
|
}
|
||||||
luetCompiler := compiler.NewLuetCompiler(compilerBackend, generalRecipe.GetDatabase(), compiler.NewDefaultCompilerOptions())
|
opts := compiler.NewDefaultCompilerOptions()
|
||||||
|
opts.Clean = clean
|
||||||
|
luetCompiler := compiler.NewLuetCompiler(compilerBackend, generalRecipe.GetDatabase(), opts)
|
||||||
luetCompiler.SetConcurrency(concurrency)
|
luetCompiler.SetConcurrency(concurrency)
|
||||||
luetCompiler.SetCompressionType(compiler.CompressionImplementation(compressionType))
|
luetCompiler.SetCompressionType(compiler.CompressionImplementation(compressionType))
|
||||||
if !all {
|
if !all {
|
||||||
@@ -151,6 +154,7 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
Fatal(err)
|
Fatal(err)
|
||||||
}
|
}
|
||||||
|
buildCmd.Flags().Bool("clean", true, "Build all packages without considering the packages present in the build directory")
|
||||||
buildCmd.Flags().String("tree", path, "Source luet tree")
|
buildCmd.Flags().String("tree", path, "Source luet tree")
|
||||||
buildCmd.Flags().String("backend", "docker", "backend used (docker,img)")
|
buildCmd.Flags().String("backend", "docker", "backend used (docker,img)")
|
||||||
buildCmd.Flags().Int("concurrency", runtime.NumCPU(), "Concurrency")
|
buildCmd.Flags().Int("concurrency", runtime.NumCPU(), "Concurrency")
|
||||||
|
Reference in New Issue
Block a user