commit
3a7100fc08
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -370,7 +370,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "espanso"
|
||||
version = "0.3.3"
|
||||
version = "0.3.4"
|
||||
dependencies = [
|
||||
"backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "espanso"
|
||||
version = "0.3.3"
|
||||
version = "0.3.4"
|
||||
authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
|
||||
license = "GPL-3.0"
|
||||
description = "Cross-platform Text Expander written in Rust"
|
||||
|
@ -18,7 +18,6 @@ clap = "2.33.0"
|
|||
regex = "1.3.1"
|
||||
log = "0.4.8"
|
||||
simplelog = "0.7.1"
|
||||
zip = "0.5.3"
|
||||
fs2 = "0.4.3"
|
||||
serde_json = "1.0.40"
|
||||
log-panics = {version = "2.0.0", features = ["with-backtrace"]}
|
||||
|
@ -34,5 +33,8 @@ dialoguer = "0.4.0"
|
|||
[target.'cfg(unix)'.dependencies]
|
||||
libc = "0.2.62"
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
zip = "0.5.3"
|
||||
|
||||
[build-dependencies]
|
||||
cmake = "0.1.31"
|
|
@ -454,6 +454,8 @@ int32_t is_current_window_terminal() {
|
|||
return 1;
|
||||
}else if (strstr(class_buffer, "Terminator") != NULL) { // Terminator
|
||||
return 1;
|
||||
}else if (strstr(class_buffer, "St") != NULL) { // Simple terminal
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ pub(crate) mod runtime;
|
|||
|
||||
const DEFAULT_CONFIG_FILE_CONTENT : &str = include_str!("../res/config.yml");
|
||||
|
||||
const DEFAULT_CONFIG_FILE_NAME : &str = "default.yml";
|
||||
pub const DEFAULT_CONFIG_FILE_NAME : &str = "default.yml";
|
||||
const USER_CONFIGS_FOLDER_NAME: &str = "user";
|
||||
|
||||
// Default values for primitives
|
||||
|
|
39
src/main.rs
39
src/main.rs
|
@ -116,8 +116,16 @@ fn main() {
|
|||
.subcommand(SubCommand::with_name("status")
|
||||
.about("Check if the espanso daemon is running or not."))
|
||||
.subcommand(SubCommand::with_name("path")
|
||||
.about("Prints all the current espanso directory paths, to easily locate configuration and data paths."))
|
||||
|
||||
.about("Prints all the current espanso directory paths, to easily locate configuration and data paths.")
|
||||
.subcommand(SubCommand::with_name("config")
|
||||
.about("Print the current config folder path."))
|
||||
.subcommand(SubCommand::with_name("packages")
|
||||
.about("Print the current packages folder path."))
|
||||
.subcommand(SubCommand::with_name("data")
|
||||
.about("Print the current data folder path."))
|
||||
.subcommand(SubCommand::with_name("default")
|
||||
.about("Print the default configuration file path."))
|
||||
)
|
||||
// Package manager
|
||||
.subcommand(SubCommand::with_name("package")
|
||||
.about("Espanso package manager commands")
|
||||
|
@ -214,8 +222,8 @@ fn main() {
|
|||
return;
|
||||
}
|
||||
|
||||
if matches.subcommand_matches("path").is_some() {
|
||||
path_main(config_set);
|
||||
if let Some(matches) = matches.subcommand_matches("path") {
|
||||
path_main(config_set, matches);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -821,10 +829,25 @@ fn list_package_main(_config_set: ConfigSet, matches: &ArgMatches) {
|
|||
}
|
||||
}
|
||||
|
||||
fn path_main(_config_set: ConfigSet) {
|
||||
println!("Config: {}", crate::context::get_config_dir().to_string_lossy());
|
||||
println!("Packages: {}", crate::context::get_package_dir().to_string_lossy());
|
||||
println!("Data: {}", crate::context::get_data_dir().to_string_lossy());
|
||||
fn path_main(_config_set: ConfigSet, matches: &ArgMatches) {
|
||||
let config = crate::context::get_config_dir();
|
||||
let packages = crate::context::get_package_dir();
|
||||
let data = crate::context::get_data_dir();
|
||||
|
||||
if matches.subcommand_matches("config").is_some() {
|
||||
println!("{}", config.to_string_lossy());
|
||||
}else if matches.subcommand_matches("packages").is_some() {
|
||||
println!("{}", packages.to_string_lossy());
|
||||
}else if matches.subcommand_matches("data").is_some() {
|
||||
println!("{}", data.to_string_lossy());
|
||||
}else if matches.subcommand_matches("default").is_some() {
|
||||
let default_file = config.join(crate::config::DEFAULT_CONFIG_FILE_NAME);
|
||||
println!("{}", default_file.to_string_lossy());
|
||||
}else{
|
||||
println!("Config: {}", config.to_string_lossy());
|
||||
println!("Packages: {}", packages.to_string_lossy());
|
||||
println!("Data: {}", data.to_string_lossy());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user