Skip to content

Commit

Permalink
feat: added default build command for the init
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGirardot committed Feb 10, 2025
1 parent 8f97205 commit 9e7b7e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/cli/src/commands/components/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ pub async fn run(_opts: Options) -> anyhow::Result<()> {
package: Package {
name: component_name,
version: "0.1.0".to_string(),
wit_world_version: "0.1.0".to_string(),
wit_world_version: "0.4.0".to_string(),
build: Build {
command: "".to_string(),
command: component_language.default_build_command.to_string(),
output_path: std::path::PathBuf::from(""),
},
},
Expand Down
7 changes: 7 additions & 0 deletions crates/cli/src/components/boilerplates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pub struct LanguageConfig {
pub name: &'static str,
pub repo_url: &'static str,
pub default_build_command: &'static str,
}

impl std::fmt::Display for LanguageConfig {
Expand All @@ -14,25 +15,31 @@ pub static LANGUAGE_OPTIONS: &[LanguageConfig] = &[
LanguageConfig {
name: "Rust",
repo_url: "https://github.com/edgee-cloud/example-rust-component",
default_build_command: "cargo build --release",
},
LanguageConfig {
name: "Go",
repo_url: "https://github.com/edgee-cloud/example-go-component",
default_build_command: "go build -o main .",
},
LanguageConfig {
name: "Python",
repo_url: "https://github.com/edgee-cloud/example-py-component",
default_build_command: "python main.py",
},
LanguageConfig {
name: "JavaScript",
repo_url: "https://github.com/edgee-cloud/example-js-component",
default_build_command: "node main.js",
},
LanguageConfig {
name: "CSharp",
repo_url: "https://github.com/edgee-cloud/example-csharp-component",
default_build_command: "dotnet build",
},
LanguageConfig {
name: "C",
repo_url: "https://github.com/edgee-cloud/example-c-component",
default_build_command: "gcc main.c -o main",
},
];

0 comments on commit 9e7b7e8

Please sign in to comment.