mirror of
https://github.com/SkyfallWasTaken/dinopkg.git
synced 2025-05-22 08:53:06 +00:00
Add package.json discovery
This commit is contained in:
parent
7117a31926
commit
450e02e54b
5 changed files with 54 additions and 6 deletions
|
@ -9,4 +9,6 @@ color-eyre = "0.6.3"
|
|||
owo-colors = "4.0.0"
|
||||
reqwest = "0.12.5"
|
||||
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
|
||||
dinopkg-package-json = { path = "../dinopkg-package-json" }
|
||||
dinopkg-package-json = { path = "../dinopkg-package-json", features = [
|
||||
"tokio",
|
||||
] }
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
use color_eyre::Result;
|
||||
use dinopkg_package_json::PackageJson;
|
||||
|
||||
pub async fn run(script_name: Option<String>) {}
|
||||
pub async fn run(script_name: Option<String>) -> Result<()> {
|
||||
let package_json = PackageJson::from_file(10).await?;
|
||||
println!("Running script: {:?} {}", script_name, package_json.name);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
use clap::Parser;
|
||||
|
||||
mod command;
|
||||
use color_eyre::Result;
|
||||
use command::{Cli, Command};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
async fn main() -> Result<()> {
|
||||
let cli = Cli::parse();
|
||||
match cli.command {
|
||||
Command::Run { script_name } => command::run::run(script_name).await,
|
||||
Command::Run { script_name } => command::run::run(script_name).await?,
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue