Skip to content

Commit 1663ce8

Browse files
committed
Update version number, add version command and fix lutris not installed error message
1 parent 32e2460 commit 1663ce8

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "eidolon"
3-
version = "1.1.5"
3+
version = "1.2.5"
44
authors = ["nicohman <nico.hickman@gmail.com>"]
55
description="Provides a single TUI-based registry for drm-free, wine and steam games on linux, accessed through a rofi launch menu."
66
readme="README.md"

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Alternatively, check [here](https://github.com/nicohman/eidolon/releases) for a
2222
`eidolon help` for list of commands:
2323
```Commands:
2424
25-
update : updates registry with installed steam games
26-
25+
update : updates registry with installed steam games and lutris wine games
26+
2727
add [name] [file] : adds game to registry
2828
2929
list : lists all installed games
@@ -40,6 +40,8 @@ imports [dir] : imports in all game directories within given directory
4040
4141
wine_add [name] [.exe] : adds windows exe to be run under wine to the registry
4242
43+
version : displays the current eidolon version and contact info
44+
4345
help : show this screen
4446
4547
```

src/eid_lib/mod.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,26 @@ pub mod eidolon {
2727
}
2828
}
2929
pub fn get_lutris() -> Result<Vec<(String, String)>, io::Error> {
30-
let games = Command::new("lutris").arg("-l").output().expect("Couldn't run lutris list games command");
31-
if games.status.success() {
32-
let games_list = String::from_utf8_lossy(&games.stdout);
33-
Ok(games_list.lines().filter(|x| x.find("wine").is_some()).map(|x| {
34-
let n = x.split("|").collect::<Vec<&str>>();
35-
(String::from(n[0].trim()), String::from(n[1].trim()))
36-
}).collect::<Vec<(String, String)>>())
30+
let games = Command::new("lutris").arg("-l").output();
31+
if games.is_ok(){
32+
let games = games.unwrap();
33+
if games.status.success() {
34+
let games_list = String::from_utf8_lossy(&games.stdout);
35+
Ok(games_list.lines().filter(|x| x.find("wine").is_some()).map(|x| {
36+
let n = x.split("|").collect::<Vec<&str>>();
37+
(String::from(n[0].trim()), String::from(n[1].trim()))
38+
}).collect::<Vec<(String, String)>>())
39+
} else {
40+
Err(Error::new(ErrorKind::NotFound, "Lutris not installed"))
41+
}
3742
} else {
3843
Err(Error::new(ErrorKind::NotFound, "Lutris not installed"))
3944
}
4045
}
4146
pub fn update_lutris() {
4247
let lut = get_lutris();
4348
if lut.is_err() {
44-
println!(">> No wine games found in lutris");
49+
println!(">> No wine games found in lutris, or lutris not installed");
4550
} else {
4651
println!(">> Reading in lutris wine games");
4752
for game in lut.unwrap() {

src/main.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ fn interpret_args() {
3232
eidolon::update_steam(steam_dirs);
3333
eidolon::update_lutris();
3434
},
35+
"version" => print_version(),
3536
"add" => eidolon::add_game(&args[2], &args[3], false),
3637
"rm" => eidolon::rm_game(&args[2]),
3738
"help" => print_help(),
@@ -61,6 +62,11 @@ fn check_args_num(num:usize, command:&str) -> bool {
6162
true
6263
}
6364
}
65+
fn print_version() {
66+
println!("Eidolon Game Launcher v1.2.5");
67+
println!("Created by Nicholas Hickman");
68+
println!("For support, file an issue at https://github.com/nicohman/eidolon or email nico.hickman@gmail.com");
69+
}
6470
fn show_menu(menu_command: String, prefix_command:String) {
6571
//Creates a list of all installed games, then pipes them to a dmenu rofi
6672
let mut entries = fs::read_dir(eidolon::get_home() + "/.config/eidolon/games")
@@ -104,7 +110,7 @@ fn show_menu(menu_command: String, prefix_command:String) {
104110
}
105111
fn print_help() {
106112
println!("Commands:");
107-
println!("update : updates registry with installed steam games");
113+
println!("update : updates registry with installed steam games and lutris wine games");
108114
println!("add [name] [file] : adds game to registry");
109115
println!("list : lists installed games");
110116
println!("rm [name] : removes game from registry");
@@ -113,6 +119,7 @@ fn print_help() {
113119
println!("import [dir] : attempts to import in game directory just from name of location.");
114120
println!("imports [dir] : imports in all game directories within given directory");
115121
println!("wine_add [name] [.exe] : adds windows exe to be run under wine to the registry");
122+
println!("version : displays the current eidolon version and contact info");
116123
println!("help : show this screen");
117124
}
118125

0 commit comments

Comments
 (0)