mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 05:06:29 +00:00
Install plugin from CLI (#304)
* add install command * cargo fmt * filter spec files * Update src/cli/plugin.rs Co-Authored-By: Lucien Greathouse <me@lpghatguy.com> * Update src/cli/plugin.rs Co-Authored-By: Lucien Greathouse <me@lpghatguy.com> * fix comments * encode plugin with rbx_binary * update build script * refactor pathbuf error into io error * fix rojo typo * remove snafu * Update `snapshot_from_fs_path` * Print `rerun-if-changed` even for directories, in order to run the build.rs script when files are added. * Switch `filter_map` loop to a regular for loop. I like the FP-style iterator stuff in Rust, but I think Result handling is easier in a normal loop. Also, I don't believe the result of read_dir implements `ExactSizedIterator`, so some of the wins of map+collect aren't there. * Replace Result::unwrap with ? in build.rs * Simplify error handling code in runtime * Checkout with submodules Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
mod build;
|
||||
mod doc;
|
||||
mod init;
|
||||
mod plugin;
|
||||
mod serve;
|
||||
mod upload;
|
||||
|
||||
@@ -21,6 +22,7 @@ use thiserror::Error;
|
||||
pub use self::build::*;
|
||||
pub use self::doc::*;
|
||||
pub use self::init::*;
|
||||
pub use self::plugin::*;
|
||||
pub use self::serve::*;
|
||||
pub use self::upload::*;
|
||||
|
||||
@@ -111,6 +113,9 @@ pub enum Subcommand {
|
||||
|
||||
/// Open Rojo's documentation in your browser.
|
||||
Doc,
|
||||
|
||||
/// Manages Rojo's Roblox Studio plugin.
|
||||
Plugin(PluginCommand),
|
||||
}
|
||||
|
||||
/// Initializes a new Rojo project.
|
||||
@@ -287,3 +292,21 @@ fn resolve_path(path: &Path) -> Cow<'_, Path> {
|
||||
Cow::Owned(env::current_dir().unwrap().join(path))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub enum PluginSubcommand {
|
||||
/// Install the plugin in Roblox Studio's plugins folder. If the plugin is
|
||||
/// already installed, installing it again will overwrite the current plugin
|
||||
/// file.
|
||||
Install,
|
||||
|
||||
/// Removes the plugin if it is installed.
|
||||
Uninstall,
|
||||
}
|
||||
|
||||
/// Install Rojo's plugin.
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct PluginCommand {
|
||||
#[structopt(subcommand)]
|
||||
subcommand: PluginSubcommand,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user