feat(goose-cli): add feature to disable update (#5886)
Signed-off-by: Sai Karthik <kskarthik@disroot.org>
This commit is contained in:
@@ -64,6 +64,9 @@ urlencoding = "2.1"
|
|||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
winapi = { version = "0.3", features = ["wincred"] }
|
winapi = { version = "0.3", features = ["wincred"] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# disables the update command
|
||||||
|
disable-update = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
use std::process::Command;
|
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
const DOWNLOAD_SCRIPT_URL: &str =
|
const DOWNLOAD_SCRIPT_URL: &str =
|
||||||
"https://github.com/block/goose/releases/download/stable/download_cli.sh";
|
"https://github.com/block/goose/releases/download/stable/download_cli.sh";
|
||||||
|
|
||||||
pub fn update(canary: bool, reconfigure: bool) -> Result<()> {
|
pub fn update(canary: bool, reconfigure: bool) -> Result<()> {
|
||||||
|
if cfg!(feature = "disable-update") {
|
||||||
|
anyhow::bail!("This command is disabled");
|
||||||
|
};
|
||||||
|
|
||||||
// Get the download script from github
|
// Get the download script from github
|
||||||
let curl_output = Command::new("curl")
|
let curl_output = Command::new("curl")
|
||||||
.arg("-fsSL")
|
.arg("-fsSL")
|
||||||
|
|||||||
Reference in New Issue
Block a user