Skip to content

Commit

Permalink
fix: error when .oscar_history isn't available.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Simpson committed Dec 13, 2019
1 parent 5fc4c6b commit 54c7eaa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ deploy:
# and nightly channels. This condition makes sure there is only one release
# for such targets and that's generated using the stable channel
condition: $TRAVIS_RUST_VERSION = stable
# tags: true
tags: true
provider: releases
skip_cleanup: true

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oscar"
version = "0.1.0"
version = "0.1.2"
authors = ["Adam Simpson <[email protected]>"]
edition = "2018"
description = "A CLI application to download Sesame Street videos from PBS. Ideally run in cron or another scheduler."
Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ fn get_history() -> Result<String, Box<dyn std::error::Error>> {
.expect("Home dir is expanded.")
.to_string_lossy()
);
let ids = fs::read_to_string(history_path)?;
Ok(ids)
let ids = fs::read_to_string(history_path);
let history = match ids {
Ok(f) => f,
_ => "".to_string(),
};

Ok(history)
}

fn update_history(episodes: &str) {
Expand Down

0 comments on commit 54c7eaa

Please sign in to comment.