fix cargo install failure (#1054)
This commit is contained in:
Generated
+4
-4
@@ -4118,7 +4118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
|
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"windows-targets 0.52.6",
|
"windows-targets 0.48.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7325,8 +7325,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "service-manager"
|
name = "service-manager"
|
||||||
version = "0.7.1"
|
version = "0.8.0"
|
||||||
source = "git+https://github.com/chipsenkbeil/service-manager-rs.git?branch=main#13dae5e8160f91fdc9834d847165cc5ce0a72fb3"
|
source = "git+https://github.com/chipsenkbeil/service-manager-rs.git?branch=main#0294d3b9769c8ef7db8b4e831fb1c4f14b7d473b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"dirs 4.0.0",
|
"dirs 4.0.0",
|
||||||
@@ -9696,7 +9696,7 @@ version = "0.1.9"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -185,8 +185,11 @@ struct InstallArgs {
|
|||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
display_name: Option<String>,
|
display_name: Option<String>,
|
||||||
|
|
||||||
#[arg(long, default_value = "false")]
|
#[arg(long)]
|
||||||
disable_autostart: bool,
|
disable_autostart: Option<bool>,
|
||||||
|
|
||||||
|
#[arg(long)]
|
||||||
|
disable_restart_on_failure: Option<bool>,
|
||||||
|
|
||||||
#[arg(long, help = "path to easytier-core binary")]
|
#[arg(long, help = "path to easytier-core binary")]
|
||||||
core_path: Option<PathBuf>,
|
core_path: Option<PathBuf>,
|
||||||
@@ -697,6 +700,7 @@ impl CommandHandler<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct ServiceInstallOptions {
|
pub struct ServiceInstallOptions {
|
||||||
pub program: PathBuf,
|
pub program: PathBuf,
|
||||||
pub args: Vec<OsString>,
|
pub args: Vec<OsString>,
|
||||||
@@ -704,6 +708,7 @@ pub struct ServiceInstallOptions {
|
|||||||
pub disable_autostart: bool,
|
pub disable_autostart: bool,
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
pub display_name: Option<String>,
|
pub display_name: Option<String>,
|
||||||
|
pub disable_restart_on_failure: bool,
|
||||||
}
|
}
|
||||||
pub struct Service {
|
pub struct Service {
|
||||||
lable: ServiceLabel,
|
lable: ServiceLabel,
|
||||||
@@ -720,6 +725,8 @@ impl Service {
|
|||||||
let service_manager = <dyn ServiceManager>::native()?;
|
let service_manager = <dyn ServiceManager>::native()?;
|
||||||
let kind = ServiceManagerKind::native()?;
|
let kind = ServiceManagerKind::native()?;
|
||||||
|
|
||||||
|
println!("service manager kind: {:?}", kind);
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
lable: name.parse()?,
|
lable: name.parse()?,
|
||||||
kind,
|
kind,
|
||||||
@@ -737,6 +744,7 @@ impl Service {
|
|||||||
username: None,
|
username: None,
|
||||||
working_directory: Some(options.work_directory.clone()),
|
working_directory: Some(options.work_directory.clone()),
|
||||||
environment: None,
|
environment: None,
|
||||||
|
disable_restart_on_failure: options.disable_restart_on_failure,
|
||||||
};
|
};
|
||||||
if self.status()? != ServiceStatus::NotInstalled {
|
if self.status()? != ServiceStatus::NotInstalled {
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
@@ -1231,10 +1239,14 @@ async fn main() -> Result<(), Error> {
|
|||||||
program: bin_path,
|
program: bin_path,
|
||||||
args: bin_args,
|
args: bin_args,
|
||||||
work_directory: work_dir,
|
work_directory: work_dir,
|
||||||
disable_autostart: install_args.disable_autostart,
|
disable_autostart: install_args.disable_autostart.unwrap_or(false),
|
||||||
description: Some(install_args.description),
|
description: Some(install_args.description),
|
||||||
display_name: install_args.display_name,
|
display_name: install_args.display_name,
|
||||||
|
disable_restart_on_failure: install_args
|
||||||
|
.disable_restart_on_failure
|
||||||
|
.unwrap_or(false),
|
||||||
};
|
};
|
||||||
|
println!("install_options: {:#?}", install_options);
|
||||||
service.install(&install_options)?;
|
service.install(&install_options)?;
|
||||||
}
|
}
|
||||||
ServiceSubCommand::Uninstall => {
|
ServiceSubCommand::Uninstall => {
|
||||||
|
|||||||
Reference in New Issue
Block a user