From 5008d092e3ae6912b8666ed84ba7b2bdd6d6fa9d Mon Sep 17 00:00:00 2001 From: Takayuki Maeda <41065217+TaKO8Ki@users.noreply.github.com> Date: Wed, 26 May 2021 01:57:36 +0900 Subject: [PATCH] Replace yaml with yml (#3) * replace yaml with yml * rm unneeded line --- .github/workflows/ci.yml | 7 +++++-- README.md | 4 ++-- results/.gitignore | 1 + src/main.rs | 8 ++++---- 4 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 results/.gitignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 047885d..5c97587 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache cargo registry - if: runner.os != 'macOS' uses: actions/cache@v1 with: path: ~/.cargo/registry @@ -74,10 +73,14 @@ jobs: path: ~/.cargo/git key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo build - if: runner.os != 'macOS' uses: actions/cache@v1 with: path: target key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: Cache results + uses: actions/cache@v1 + with: + path: results + key: ${{ runner.os }}-results-${{ hashFiles('**/results.yml') }} - name: Run Tests run: cargo run diff --git a/README.md b/README.md index b115b04..b86e057 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ ## `ls` -* [ogham/exa](https://github.com/ogham/exa) — A replacement for 'ls' -* [Peltoche/lsd](https://github.com/Peltoche/lsd) — An ls with a lot of pretty colors and awesome icons +* [ogham/exa](https://github.com/ogham/exa) - A replacement for 'ls' +* [Peltoche/lsd](https://github.com/Peltoche/lsd) - An ls with a lot of pretty colors and awesome icons ## `cat` diff --git a/results/.gitignore b/results/.gitignore new file mode 100644 index 0000000..fee91cf --- /dev/null +++ b/results/.gitignore @@ -0,0 +1 @@ +results.yml diff --git a/src/main.rs b/src/main.rs index 6b67506..fcf9b79 100644 --- a/src/main.rs +++ b/src/main.rs @@ -248,7 +248,7 @@ async fn main() -> Result<(), Error> { let parser = Parser::new(&markdown_input); let mut used: BTreeSet = BTreeSet::new(); - let mut results: Results = fs::read_to_string("results/results.yaml") + let mut results: Results = fs::read_to_string("results/results.yml") .map_err(|e| format_err!("{}", e)) .and_then(|x| serde_yaml::from_str(&x).map_err(|e| format_err!("{}", e))) .unwrap_or(Results::new()); @@ -297,7 +297,7 @@ async fn main() -> Result<(), Error> { for link in old_links { results.remove(link).unwrap(); } - fs::write("results/results.yaml", serde_yaml::to_string(&results)?)?; + fs::write("results/results.yml", serde_yaml::to_string(&results)?)?; let mut not_written = 0; let mut last_written = Local::now(); @@ -345,12 +345,12 @@ async fn main() -> Result<(), Error> { not_written += 1; let duration = Local::now() - last_written; if duration > Duration::seconds(5) || not_written > 20 { - fs::write("results/results.yaml", serde_yaml::to_string(&results)?)?; + fs::write("results/results.yml", serde_yaml::to_string(&results)?)?; not_written = 0; last_written = Local::now(); } } - fs::write("results/results.yaml", serde_yaml::to_string(&results)?)?; + fs::write("results/results.yml", serde_yaml::to_string(&results)?)?; println!(""); let mut failed: u32 = 0;