Skip to content

Commit e5aca8d

Browse files
feat: make remote-wallet support optional via feature flag
1 parent 7a57245 commit e5aca8d

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/main.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ use {
88
keypair::DefaultSigner,
99
},
1010
solana_client::rpc_client::RpcClient,
11-
solana_remote_wallet::remote_wallet::RemoteWalletManager,
1211
solana_sdk::{commitment_config::CommitmentConfig, native_token::Sol, signature::Signer},
1312
std::{env, process::exit, sync::Arc},
1413
};
14+
15+
#[cfg(feature = "remote-wallet")]
16+
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
1517
pub mod clparse;
1618
pub mod prelude;
1719
pub mod utils;
@@ -29,8 +31,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
2931
let app_matches = parse_command_line();
3032
let (sub_command, sub_matches) = app_matches.subcommand();
3133
let matches = sub_matches.unwrap();
34+
35+
#[cfg(feature = "remote-wallet")]
3236
let mut wallet_manager: Option<Arc<RemoteWalletManager>> = None;
3337

38+
#[cfg(not(feature = "remote-wallet"))]
39+
let wallet_manager = None;
40+
3441
// Check if colors should be disabled (via flag or environment variable)
3542
let no_color = matches.is_present("no_color") || env::var("NO_COLOR").is_ok();
3643
if no_color {
@@ -60,12 +67,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
6067
.unwrap_or(&cli_config.json_rpc_url)
6168
.to_string(),
6269
),
70+
#[cfg(feature = "remote-wallet")]
6371
default_signer: default_signer
6472
.signer_from_path(matches, &mut wallet_manager)
6573
.unwrap_or_else(|err| {
6674
eprintln!("error: {}", err);
6775
exit(1);
6876
}),
77+
#[cfg(not(feature = "remote-wallet"))]
78+
default_signer: default_signer
79+
.signer_from_path(matches, &None)
80+
.unwrap_or_else(|err| {
81+
eprintln!("error: {}", err);
82+
exit(1);
83+
}),
6984
// Count occurrences of the verbose flag to determine verbosity level
7085
verbose: matches.occurrences_of("verbose") as u8,
7186
no_color,

src/utils/ssh_deploy/services.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ pub fn create_binary_service_content(
166166
WantedBy=multi-user.target\n",
167167
description, working_dir, binary_path, args_str
168168
)
169-
}
169+
}

0 commit comments

Comments
 (0)