Bug fix start (#1738)

* fix bug on linux; added start to the stable list

* add to stable and fix clippy lint
This commit is contained in:
Elton Leander Pinto 2020-05-09 13:28:57 -04:00 committed by GitHub
parent 55374ee54f
commit ccd5d69fd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 1 deletions

1
Cargo.lock generated
View file

@ -2093,6 +2093,7 @@ dependencies = [
"nu_plugin_match", "nu_plugin_match",
"nu_plugin_post", "nu_plugin_post",
"nu_plugin_ps", "nu_plugin_ps",
"nu_plugin_start",
"nu_plugin_str", "nu_plugin_str",
"nu_plugin_sys", "nu_plugin_sys",
"nu_plugin_textview", "nu_plugin_textview",

View file

@ -32,6 +32,7 @@ nu_plugin_inc = { version = "0.13.0", path = "./crates/nu_plugin_inc", optional=
nu_plugin_match = { version = "0.13.0", path = "./crates/nu_plugin_match", optional=true } nu_plugin_match = { version = "0.13.0", path = "./crates/nu_plugin_match", optional=true }
nu_plugin_post = { version = "0.13.0", path = "./crates/nu_plugin_post", optional=true } nu_plugin_post = { version = "0.13.0", path = "./crates/nu_plugin_post", optional=true }
nu_plugin_ps = { version = "0.13.0", path = "./crates/nu_plugin_ps", optional=true } nu_plugin_ps = { version = "0.13.0", path = "./crates/nu_plugin_ps", optional=true }
nu_plugin_start = { version = "0.1.0", path = "./crates/nu_plugin_start", optional=true }
nu_plugin_str = { version = "0.13.0", path = "./crates/nu_plugin_str", optional=true } nu_plugin_str = { version = "0.13.0", path = "./crates/nu_plugin_str", optional=true }
nu_plugin_sys = { version = "0.13.0", path = "./crates/nu_plugin_sys", optional=true } nu_plugin_sys = { version = "0.13.0", path = "./crates/nu_plugin_sys", optional=true }
nu_plugin_textview = { version = "0.13.0", path = "./crates/nu_plugin_textview", optional=true } nu_plugin_textview = { version = "0.13.0", path = "./crates/nu_plugin_textview", optional=true }
@ -62,7 +63,7 @@ nu-build = { version = "0.13.0", path = "./crates/nu-build" }
test-bins = [] test-bins = []
default = ["sys", "ps", "textview", "inc", "str"] default = ["sys", "ps", "textview", "inc", "str"]
stable = ["default", "starship-prompt", "binaryview", "match", "tree", "average", "post", "fetch", "clipboard-cli", "trash-support"] stable = ["default", "starship-prompt", "binaryview", "match", "tree", "average", "post", "fetch", "clipboard-cli", "trash-support", "start"]
# Default # Default
textview = ["crossterm", "syntect", "url", "nu_plugin_textview"] textview = ["crossterm", "syntect", "url", "nu_plugin_textview"]
@ -79,6 +80,7 @@ match = ["nu_plugin_match"]
post = ["nu_plugin_post"] post = ["nu_plugin_post"]
trace = ["nu-parser/trace"] trace = ["nu-parser/trace"]
tree = ["nu_plugin_tree"] tree = ["nu_plugin_tree"]
start = ["nu_plugin_start"]
clipboard-cli = ["nu-cli/clipboard-cli"] clipboard-cli = ["nu-cli/clipboard-cli"]
starship-prompt = ["nu-cli/starship-prompt"] starship-prompt = ["nu-cli/starship-prompt"]
@ -168,6 +170,11 @@ name = "nu_plugin_stable_tree"
path = "src/plugins/nu_plugin_stable_tree.rs" path = "src/plugins/nu_plugin_stable_tree.rs"
required-features = ["tree"] required-features = ["tree"]
[[bin]]
name = "nu_plugin_stable_start"
path = "src/plugins/nu_plugin_stable_start.rs"
required-features = ["start"]
# Main nu binary # Main nu binary
[[bin]] [[bin]]
name = "nu" name = "nu"

View file

@ -144,6 +144,8 @@ impl Start {
for cmd in &["xdg-open", "gnome-open", "kde-open", "wslview"] { for cmd in &["xdg-open", "gnome-open", "kde-open", "wslview"] {
if exec_cmd(cmd, &args).is_err() { if exec_cmd(cmd, &args).is_err() {
continue; continue;
} else {
return Ok(());
} }
} }
Err(StartError::new( Err(StartError::new(

View file

@ -0,0 +1,9 @@
use nu_plugin::serve_plugin;
use nu_plugin_start::Start;
fn main() {
serve_plugin(&mut Start {
filenames: vec![],
application: None,
});
}