Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
296 changes: 296 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "horns"
version = "0.1.0"
edition = "2024"

[dependencies]
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.141"
clap = { version = "4", features = ["derive"] }
Empty file modified rhino-deploy
100755 → 100644
Empty file.
32 changes: 32 additions & 0 deletions src/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"id": "install",
"title": "Step 1 | ask = true",
"detail": "apt build-essential cmake git python3-pip docker.io",
"ask": "true"
},
{
"id": "script",
"title": "Step 2 | ask = false",
"detail": "apt update && apt upgrade -y",
"ask": "false"
},
{
"id": "install",
"title": "Step 4 | ask = false",
"detail": "flatpak org.gimp.GIMP org.mozilla.firefox",
"ask": "false"
},
{
"id": "script",
"title": "Step 10 | ask = false",
"detail": "sudo apt autoremove && sudo apt clean",
"ask": "false"
},
{
"id": "script",
"title": "Step 11 | ask = true",
"detail": "which gcc cmake git docker nginx",
"ask": "true"
}
]
31 changes: 31 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
mod todos;

use clap::{Parser, Subcommand};
use std::error::Error;

#[derive(Parser)]
#[command(name = "horns")]
struct Cli {
#[command(subcommand)]
command: Commands,
}

#[derive(Subcommand)]
enum Commands {
ConfigRestore {
path: String,
},
}

fn main() -> Result<(), Box<dyn Error>> {
let cli = Cli::parse();

match cli.command {
Commands::ConfigRestore { path } => {
let todos = todos::read_todos(&path)?;
todos::print_todos(&todos);
}
}

Ok(())
}
Loading