fix(commands): add install default assets (#961)
This commit is contained in:
parent
590d3479e6
commit
b81268e80c
1 changed files with 11 additions and 4 deletions
|
|
@ -87,6 +87,12 @@ fn create_new_client() -> ClientInfo {
|
||||||
ClientInfo::New(names::Generator::default().next().unwrap())
|
ClientInfo::New(names::Generator::default().next().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn install_default_assets(opts: &CliArgs) {
|
||||||
|
let data_dir = opts.data_dir.clone().unwrap_or_else(get_default_data_dir);
|
||||||
|
#[cfg(not(disable_automatic_asset_installation))]
|
||||||
|
populate_data_dir(&data_dir);
|
||||||
|
}
|
||||||
|
|
||||||
fn find_indexed_session(
|
fn find_indexed_session(
|
||||||
sessions: Vec<String>,
|
sessions: Vec<String>,
|
||||||
config_options: Options,
|
config_options: Options,
|
||||||
|
|
@ -199,6 +205,10 @@ pub(crate) fn start_client(opts: CliArgs) {
|
||||||
ClientInfo::New(_) => layout,
|
ClientInfo::New(_) => layout,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if create {
|
||||||
|
install_default_assets(&opts);
|
||||||
|
}
|
||||||
|
|
||||||
start_client_impl(
|
start_client_impl(
|
||||||
Box::new(os_input),
|
Box::new(os_input),
|
||||||
opts,
|
opts,
|
||||||
|
|
@ -210,10 +220,7 @@ pub(crate) fn start_client(opts: CliArgs) {
|
||||||
} else {
|
} else {
|
||||||
let start_client_plan = |session_name: std::string::String| {
|
let start_client_plan = |session_name: std::string::String| {
|
||||||
assert_session_ne(&session_name);
|
assert_session_ne(&session_name);
|
||||||
|
install_default_assets(&opts);
|
||||||
let data_dir = opts.data_dir.clone().unwrap_or_else(get_default_data_dir);
|
|
||||||
#[cfg(not(disable_automatic_asset_installation))]
|
|
||||||
populate_data_dir(&data_dir);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(session_name) = opts.session.clone() {
|
if let Some(session_name) = opts.session.clone() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue