Skip to content

Commit a8dc36c

Browse files
author
Humble Penguin
committed
Add support for fish shell
1 parent 571f0dc commit a8dc36c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bin/envio/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl Command {
7171
create_profile(command_args.args[0].clone(), None, &user_key);
7272
} else if command_args.args.len() == 2 {
7373
if !Path::new(&command_args.args[0]).exists() {
74-
println!("{}: File does not exists", "Error".red());
74+
println!("{}: File does not exist", "Error".red());
7575
return;
7676
}
7777
let profile_name = command_args.args[1].clone();

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ impl Profile {
111111
shell_config = ".bashrc";
112112
} else if current_shell.contains("zsh") {
113113
shell_config = ".zshrc";
114+
} else if current_shell.contains("fish") {
115+
shell_config = ".config/fish/config.fish"
114116
}
115117

116118
if !shellscript_path.exists() {
@@ -415,7 +417,7 @@ pub fn delete_profile(name: String) {
415417
Err(e) => println!("{}: {}", "Error".red(), e),
416418
}
417419
} else {
418-
println!("{}: Profile does not exists", "Error".red());
420+
println!("{}: Profile does not exist", "Error".red());
419421
}
420422
}
421423

@@ -498,7 +500,7 @@ pub fn download_profile(url: String, profile_name: String) {
498500
*/
499501
pub fn import_profile(file_path: String, profile_name: String) {
500502
if !Path::new(&file_path).exists() {
501-
println!("{}: File does not exists", "Error".red());
503+
println!("{}: File does not exist", "Error".red());
502504
return;
503505
}
504506

@@ -623,6 +625,7 @@ pub fn create_shellscript() {
623625
// @return String
624626
#[cfg(any(target_family = "unix"))]
625627
pub fn get_shell() -> String {
628+
// Gets your default shell
626629
let shell = std::env::var("SHELL").unwrap();
627630
let shell = shell.split('/').collect::<Vec<&str>>();
628631

0 commit comments

Comments
 (0)