build(deps): bump time from 0.3.25 to 0.3.26
[ouch.git] / benchmarks / setup-benchmarks.sh
blobced6f3f29afcc16b9f13dd9d272b2e3238c9963c
1 #!/usr/bin/env bash
3 # Run this script inside of the folder `benchmarks` to download
4 # the input files to run the benchmarks.
6 # ```
7 # cd benchmarks
8 # ./setup-benchmarks.sh
9 # ```
11 # It will download rust-lang's source code.
13 # After this, you can run `./run-benchmarks.sh`.
15 # Input files downloaded:
16 # - `compiler` (27 MB) for compressed formats.
17 # - `rust` (229 MB) for uncompressed formats.
19 set -e
21 function setup() {
22 if [[ -d "rust" || -d "compiler" ]]; then
23 echo "Input files already exist, try deleting before downloading again."
24 exit 1
27 # Download the Rust 1.65.0 source code
28 git clone -b 1.65.0 https://github.com/rust-lang/rust --depth 1
30 # Delete write-protected files to make benchmark cleanup simpler
31 rm rust/.git -fr
33 # Separate the compiler code
34 cp rust/compiler -r compiler
37 setup
39 echo "tip: if you see a git warning above, you can ignore it"