From 22fb1b8deecfb0aac6f637d60d08a5bc6d390fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Tue, 21 Feb 2023 16:06:58 +0100 Subject: [PATCH] add completions and man pages to release archives #43 --- .github/workflows/deployment.yml | 20 ++++++++++++++++++-- CHANGELOG.md | 3 +++ src/main.rs | 3 +-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 1e3d1f4..bb3461c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -54,10 +54,26 @@ jobs: args: --release - name: Compress executable (unix) if: matrix.os_name == 'linux' || matrix.os_name == 'macos' - run: tar czf himalaya.tar.gz -C target/release himalaya + run: | + mkdir -p target/release/{man,completions} + target/release/himalaya man target/release/man + target/release/himalaya completion bash > target/release/completions/himalaya.bash + target/release/himalaya completion elvish > target/release/completions/himalaya.elvish + target/release/himalaya completion fish > target/release/completions/himalaya.fish + target/release/himalaya completion powershell > target/release/completions/himalaya.powershell + target/release/himalaya completion zsh > target/release/completions/himalaya.zsh + tar czf himalaya.tar.gz -C target/release himalaya man completions - name: Compress executable (windows) if: matrix.os_name == 'windows' - run: tar czf himalaya.tar.gz -C target/release himalaya.exe + run: | + mkdir -p target/release/{man,completions} + target/release/himalaya.exe man target/release/man + target/release/himalaya.exe completion bash > target/release/completions/himalaya.bash + target/release/himalaya.exe completion elvish > target/release/completions/himalaya.elvish + target/release/himalaya.exe completion fish > target/release/completions/himalaya.fish + target/release/himalaya.exe completion powershell > target/release/completions/himalaya.powershell + target/release/himalaya.exe completion zsh > target/release/completions/himalaya.zsh + tar czf himalaya.tar.gz -C target/release himalaya.exe man completions - name: Upload release asset uses: actions/upload-release-asset@v1 env: diff --git a/CHANGELOG.md b/CHANGELOG.md index d32b16c..e9c0353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added `create` and `delete` folder commands [sourcehut#54]. +- Added generated completions and man pages to releases + [sourcehut#43]. ### Fixed @@ -675,4 +677,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#419]: https://github.com/soywod/himalaya/issues/419 [#430]: https://github.com/soywod/himalaya/issues/430 +[sourcehut#43]: https://todo.sr.ht/~soywod/pimalaya/43 [sourcehut#54]: https://todo.sr.ht/~soywod/pimalaya/54 diff --git a/src/main.rs b/src/main.rs index 8b83d47..320f5e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,8 +77,7 @@ fn main() -> Result<()> { _ => (), } - // checks completion command before configs - // https://github.com/soywod/himalaya/issues/115 + // also checks man command before configs match man::args::matches(&m)? { Some(man::args::Cmd::GenerateAll(dir)) => { return man::handlers::generate(dir, create_app());