add:build script
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
use std::{
|
||||
os::unix::fs,
|
||||
path::PathBuf,
|
||||
};
|
||||
use std::os::unix::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use cliclack::{confirm, input, log, note, select};
|
||||
use cliclack::{confirm, input, log, note};
|
||||
|
||||
use crate::{
|
||||
config::types::ScriptEntry,
|
||||
@@ -12,28 +10,7 @@ use crate::{
|
||||
shim::template::write_shim,
|
||||
};
|
||||
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
enum AddMode {
|
||||
Existing,
|
||||
Create,
|
||||
}
|
||||
|
||||
pub fn run(store: &ServiceStore) -> Result<(), AppError> {
|
||||
let mode = select("What would you like to do?")
|
||||
.item(AddMode::Existing, "Add existing script", "register a script that already exists")
|
||||
.item(AddMode::Create, "Create new script", "scaffold a new script from a template")
|
||||
.interact()?;
|
||||
|
||||
match mode {
|
||||
AddMode::Existing => add_existing(store),
|
||||
AddMode::Create => {
|
||||
log::info("Create new script — coming soon.")?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn add_existing(store: &ServiceStore) -> Result<(), AppError> {
|
||||
let config = store.config.load()?;
|
||||
|
||||
// ── 1. Path to the original script ────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user