Skip to content

Commit

Permalink
feat: hide fvm self install from and help introduce `fvm self updat…
Browse files Browse the repository at this point in the history
…e` (#3724)

* feat: hide `fvm self install`

* feat: add fvm update instructions

* feat: add fvm update instructions
  • Loading branch information
EstebanBorai authored Nov 17, 2023
1 parent 43f2353 commit 9607102
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/fluvio-version-manager/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fluvio-version-manager"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
authors = ["Fluvio Contributors <team@fluvio.io>"]
description = "Fluvio Version Manager"
Expand Down
6 changes: 6 additions & 0 deletions crates/fluvio-version-manager/src/command/itself/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

pub mod install;
pub mod uninstall;
pub mod update;

use anyhow::Result;
use clap::Parser;
Expand All @@ -10,13 +11,17 @@ use crate::common::notify::Notify;

use self::install::SelfInstallOpt;
use self::uninstall::SelfUninstallOpt;
use self::update::SelfUpdateOpt;

#[derive(Debug, Parser)]
pub enum ItselfCommand {
/// Install `fvm` and setup the workspace
#[clap(hide = true)]
Install(SelfInstallOpt),
/// Uninstall `fvm` and removes the workspace
Uninstall(SelfUninstallOpt),
/// Prints `fvm` update instructions
Update(SelfUpdateOpt),
}

/// The `install` command is responsible of installing the desired Package Set
Expand All @@ -32,6 +37,7 @@ impl SelfOpt {
match &self.command {
ItselfCommand::Install(cmd) => cmd.process(notify).await?,
ItselfCommand::Uninstall(cmd) => cmd.process(notify).await?,
ItselfCommand::Update(cmd) => cmd.process(notify).await?,
}

Ok(())
Expand Down
15 changes: 15 additions & 0 deletions crates/fluvio-version-manager/src/command/itself/update.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use anyhow::Result;
use clap::Parser;

use crate::common::notify::Notify;

#[derive(Clone, Debug, Parser)]
pub struct SelfUpdateOpt;

impl SelfUpdateOpt {
pub async fn process(&self, notify: Notify) -> Result<()> {
notify.info("To update fvm, please run:");
notify.info("curl -fsS https://hub.infinyon.cloud/install/install.sh | bash");
Ok(())
}
}

0 comments on commit 9607102

Please sign in to comment.