From 54c7eaa79f2a21547e4013acd09421c76228767f Mon Sep 17 00:00:00 2001 From: Adam Simpson Date: Fri, 13 Dec 2019 00:20:45 -0500 Subject: [PATCH] fix: error when .oscar_history isn't available. --- .travis.yml | 2 +- Cargo.toml | 2 +- src/main.rs | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd9ecfa..e4f3053 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index d787651..2d45e70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oscar" -version = "0.1.0" +version = "0.1.2" authors = ["Adam Simpson "] edition = "2018" description = "A CLI application to download Sesame Street videos from PBS. Ideally run in cron or another scheduler." diff --git a/src/main.rs b/src/main.rs index 0b3cf54..eb6988a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,8 +112,13 @@ fn get_history() -> Result> { .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) {