diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8a8806..4310e81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,13 @@ name: Test, build and release binary on: push: branches: - - '*' + - main pull_request: null + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check: runs-on: ubuntu-latest diff --git a/src/main.rs b/src/main.rs index a002bbc..0e1e8ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,13 +10,13 @@ const CHUNK_SIZE: usize = 1024 * 100; fn main() -> Result<()> { let args: Vec = env::args().collect(); - let tty = atty::is(atty::Stream::Stdin); + let tty = !atty::is(atty::Stream::Stdin); if let Some(arg) = args.get(1) { match tty { //Decode + Decompress + Save to file - false => from_raw(arg)?, + true => from_raw(arg)?, //Read from path + Compress + Encode - true => to_raw(arg)?, + false => to_raw(arg)?, }; } else { println!(