Skip to content

Commit

Permalink
Fix update, add vim template, version bump to 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkor committed Aug 25, 2016
1 parent 8a4a275 commit 49c4711
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
10 changes: 9 additions & 1 deletion .conf
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,16 @@
"config",
"~/.config/lemonbuddy/"
]
},
"vim": {
"deps": [
"vim"
],
"Default": [
".vimrc",
"~/"
]
}

},
"groups": {
"i3": [
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ricem"
version = "0.4.0"
version = "0.5.0"
authors = ["ed <edward.partenie@gmail.com>"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ or

`ricem edit <template name>` to open a file in your editor (specified by $VISUAL). Example: `ricem edit rc.xml` will open `~/.config/openbox/rc.xml`

`ricem update` will download the latest version of `.conf` that contains the latest templates directly from this github repo. <b>(Unstable and replaces your current .conf file which contains your themes)</b>
`ricem update` will download the latest version of `.conf` that contains the latest templates directly from this github repo.

## Obtaining
#### Dependencies:
Expand Down
13 changes: 11 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::io::*;
use std::path::Path;


const VERSION: f32 = 0.4;
const VERSION: f32 = 0.5;

fn select_theme(name: String, themes: &Vec<Theme>, json_util: &JsonUtil) -> Option<String> {
let mut json_obj = json_util.read();
Expand Down Expand Up @@ -526,7 +526,16 @@ fn main() {

},
"update" | "upd" => {
exec_shell_with_output("wget https://raw.githubusercontent.com/zakkor/ricem/master/.conf -O ~/.ricem/.conf");
exec_shell("mkdir ~/.ricem/temp");
exec_shell_with_output("wget https://raw.githubusercontent.com/zakkor/ricem/master/.conf -O ~/.ricem/temp/.conf");
let temp_conf_path = ricem_dir.join("temp").join(".conf");

let mut temp_json_obj = JsonUtil::new(&temp_conf_path).read();
let mut json_obj = json_util.read();

json_obj["templates"] = temp_json_obj["templates"].take();
json_util.write(&json_obj);
exec_shell("rm -rf ~/.ricem/temp");
},
_ => {
println!("Error: Unknown command.");
Expand Down

0 comments on commit 49c4711

Please sign in to comment.