Add exec CLI command

This commit is contained in:
worldisonline 2026-07-20 23:13:15 +02:00
parent e689c4adef
commit e1ad542531
5 changed files with 1015 additions and 4 deletions

View file

@ -66,10 +66,6 @@ Follow Rust's style guide for Rojo's server. Follow the style established in oth
- You may not create the body of an issue. You may assist with creating a title if explicitly requested. Do not ask the user if they want to do this. It is our policy that issues are for human users, not AI agents.
- If you are requested to generate a title for an issue, prefix it with "[🤖]". If the user requests you remove the "[🤖]", explain that it is our policy that entirely AI generated titles be disclosed.
## Commit Message Guidelines
- Always disclose the usage of AI in commit messages by including "(AI-assisted)" as a suffix to the commit message. Do this even if the user has turned off attributions for you. It is our policy that fully AI generated commit messages be disclosed.
## Precedence
- Disclosure policies take absolute precedence.

1001
src/cli/exec.rs Normal file

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,7 @@
mod build;
mod doc;
mod exec;
mod fmt_project;
mod init;
mod plugin;
@ -18,6 +19,7 @@ use thiserror::Error;
pub use self::build::BuildCommand;
pub use self::doc::DocCommand;
pub use self::exec::ExecCommand;
pub use self::fmt_project::FmtProjectCommand;
pub use self::init::{InitCommand, InitKind};
pub use self::plugin::{PluginCommand, PluginSubcommand};
@ -44,6 +46,7 @@ impl Options {
Subcommand::Init(subcommand) => subcommand.run(),
Subcommand::Serve(subcommand) => subcommand.run(self.global),
Subcommand::Build(subcommand) => subcommand.run(),
Subcommand::Exec(subcommand) => subcommand.run(),
Subcommand::Upload(subcommand) => subcommand.run(),
Subcommand::Sourcemap(subcommand) => subcommand.run(),
Subcommand::FmtProject(subcommand) => subcommand.run(),
@ -118,6 +121,7 @@ pub enum Subcommand {
Init(InitCommand),
Serve(ServeCommand),
Build(BuildCommand),
Exec(ExecCommand),
Upload(UploadCommand),
Sourcemap(SourcemapCommand),
FmtProject(FmtProjectCommand),

View file

@ -497,6 +497,14 @@ pub struct ErrorResponse {
}
impl ErrorResponse {
pub(crate) fn kind(&self) -> &ErrorResponseKind {
&self.kind
}
pub(crate) fn details(&self) -> &str {
&self.details
}
pub fn not_found<S: Into<String>>(details: S) -> Self {
Self {
kind: ErrorResponseKind::NotFound,

View file

@ -9,6 +9,8 @@ mod origin;
mod ui;
mod util;
pub(crate) use self::util::{deserialize_msgpack, serialize_msgpack};
use std::convert::Infallible;
use std::net::SocketAddr;
use std::sync::Arc;