-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lochlan Wansbrough
committed
Oct 12, 2024
1 parent
665b81b
commit 73a5912
Showing
11 changed files
with
109 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use rust_embed::Embed; | ||
|
||
#[derive(Embed)] | ||
#[folder = "crates/rune/wit"] | ||
pub struct RuneWits; | ||
|
||
#[derive(Embed)] | ||
#[folder = "crates/rune/wit/runtime"] | ||
pub struct RuneRuntimeWits; | ||
|
||
#[derive(Embed)] | ||
#[folder = "src/templates"] | ||
pub struct Templates; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ pub mod build; | |
pub mod bundle; | ||
pub mod docs; | ||
pub mod new; | ||
pub mod run; | ||
pub mod upgrade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use std::env; | ||
|
||
use toml::Table; | ||
|
||
use crate::cli::NewSubcommand; | ||
|
||
use crate::Result; | ||
|
||
|
||
pub async fn run(release: &bool) -> Result<()> { | ||
crate::commands::build::build(release).await?; | ||
|
||
let current_dir = env::current_dir()?; | ||
let config = std::fs::read_to_string(current_dir.join("rune.toml")) | ||
.unwrap() | ||
.parse::<Table>() | ||
.unwrap(); | ||
|
||
let entrypoint_path = match config["build"]["entrypoint"].as_str() { | ||
Some(entrypoint_path) => entrypoint_path, | ||
None => panic!("No build input provided in config!"), | ||
}; | ||
|
||
match config["build"]["output"].as_str() { | ||
Some(output_path) => { | ||
let output_path = current_dir.join(output_path); | ||
let entrypoint_path = output_path.join(entrypoint_path); | ||
let binary = std::fs::read(entrypoint_path).unwrap(); | ||
rune::runtime::run(output_path.to_path_buf(), binary); | ||
} | ||
None => panic!("No build input provided in config!"), | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters