Follow the following steps to set up the project and install the dependencies:
- Create a new binary project named sample_decom, and enter the directory:
cargo new --bin sample_decom && cd sample_decom
- Install the error_chain, tar, and flate2 crates dependencies:
cargo add error-chain tar flate2
- cargo add crate_name automatically adds the latest version of the dependency to the Cargo.toml file.
- Install the dependency by running the following command:
cargo run
- This step will print hello world as output, as we have not yet made any modifications to the source code.
- Create a sample file, TAR it, and delete it for using it in the recipe:
touch sample_file1.txt && tar -cvzf archieve.tar.gz
sample_file1.txt && rm sample_file1.txt