diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec95461..ffdf0c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,17 +38,25 @@ jobs: - name: Build binary run: cargo zigbuild --release --target ${{ matrix.target }} + - name: Get Cargo.toml version + id: get_cargo_version + run: | + CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') + echo "Cargo Version = v$CARGO_VERSION" + echo "CARGO_VERSION=$CARGO_VERSION" >> $GITHUB_ENV + - name: Rename binary for upload run: | + CURRENT_TAG=${{ github.ref_name }} ext="" if [[ "${{ matrix.target }}" == *windows* ]]; then ext=".exe"; fi mkdir -p dist - cp target/${{ matrix.target }}/release/wrapd$ext dist/${{ matrix.binary_name }}-${{ matrix.target }}$ext + cp target/${{ matrix.target }}/release/wrapd$ext dist/${{ matrix.binary_name }}-v${{ env.CARGO_VERSION }}-${{ matrix.target }}$ext - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: binaries-${{ matrix.binary_name }}-${{ matrix.target }} + name: binaries-${{ matrix.binary_name }}-v${{ env.CARGO_VERSION }}-${{ matrix.target }} path: dist/* release: diff --git a/.gitignore b/.gitignore index aa79e63..75af5f0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .direnv /test .pre-commit-config.yaml +worktrees diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4d592f6..a631c10 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -26,6 +26,12 @@ "belfz.search-crates-io", "kevinkassimo.cargo-toml-snippets", "taiyuuki.vscode-cargo-scripts", - "washan.cargo-appraiser" + "washan.cargo-appraiser", + "bradzacher.vscode-coloured-status-bar-problems", + "usernamehw.errorlens", + "pkief.material-icon-theme", + "bbenoist.nix", + "duniul.git-stage", + "gruntfuggly.todo-tree" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 0f15c94..b012092 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,7 +13,8 @@ "**/Thumbs.db": true, ".direnv": true, ".gitignore": true, - ".envrc": true + ".envrc": true, + "**/.cspell": true }, "explorerExclude.backup": {}, "editor.formatOnSaveMode": "modificationsIfAvailable", diff --git a/README.md b/README.md index 0bbcbc2..e3ecf02 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,58 @@ +[![](https://raw.githubusercontent.com/dch82/Nixpkgs-Badges/main/nixpkgs-badge-dark.svg)](https://search.nixos.org/packages?size=1&show=wrapd) + [![CI Nix](https://github.com/gignsky/wrap/actions/workflows/ci-nix.yml/badge.svg)](https://github.com/gignsky/wrap/actions/workflows/ci-nix.yml) [![Docs](https://github.com/gignsky/wrap/actions/workflows/docs.yml/badge.svg)](https://github.com/gignsky/wrap/actions/workflows/docs.yml) [![Release](https://github.com/gignsky/wrap/actions/workflows/release.yml/badge.svg)](https://github.com/gignsky/wrap/actions/workflows/release.yml) [![Update README with --help Output](https://github.com/gignsky/wrap/actions/workflows/help-to-readme.yml/badge.svg)](https://github.com/gignsky/wrap/actions/workflows/help-to-readme.yml) -A command line utility written entirely in rust that creates tarballs from folders in the current working directory and optionally remove the folders that created those tarballs +[![Packaging status](https://repology.org/badge/vertical-allrepos/wrapd.svg)](https://repology.org/project/wrapd/versions) + +# Description + +A command line utility written entirely in rust that creates tarballs from +folders in the current working directory and optionally remove the folders that +created those tarballs # Installation & Usage + ### Run immediately without installing (using Nix) + `$ nix run github:gignsky/wrapd -- {optional-arguments (i.e. --help)}` ## Installation + ### With Nix Shell (temporary installation in current shell) + `$ nix shell github:gignsky/wrapd` ### With NixOS (using flakes) -In your `flake.nix` file: + +In your `flake.nix` file: + 1. add `inputs.wrapd.url = "github:gignsky/wrapd";` to your inputs -2. inside of your `environment.systemPackages` often defined under: `outputs.nixosConfigurations.{hostname}.nixpkgs.lib.nixosSystem.modules` +2. inside of your `environment.systemPackages` often defined under: + `outputs.nixosConfigurations.{hostname}.nixpkgs.lib.nixosSystem.modules` 3. add either: 1. `inputs.wrapd.packages.${system}.wrapd` 2. `inputs.wrapd.packages.${system}.default` ### Download the binary + 1. Navigate to https://github.com/gignsky/wrapd/releases 2. Download the latest (or desired) release for your operating system - 1. As of the time of this writing only x86_64 binaries are compiled for GNU/Linux and windows + 1. As of the time of this writing only x86_64 binaries are compiled for + GNU/Linux and windows 3. if using Linux run `chmod +x ./{downloaded-binary}` -4. if using windows you can run the binary from the command prompt or powershell in order to pass arguments, if double-click running the .exe file the default process of the binary will run in the current folder of the binary without the remove flag - 1. FUTURE FUNCTIONALITY INTENDED: In the future it is intended that the program will produce a dialog box that allows the user to specify which option arguments to be used. +4. if using windows you can run the binary from the command prompt or powershell + in order to pass arguments, if double-click running the .exe file the default + process of the binary will run in the current folder of the binary without + the remove flag + 1. FUTURE FUNCTIONALITY INTENDED: In the future it is intended that the + program will produce a dialog box that allows the user to specify which + option arguments to be used. ### Compile the binary yourself + 1. git clone this repository: 1. `$ git clone https://github.com/gignsky/wrapd.git` 2. cd into the directory: @@ -46,18 +69,23 @@ In your `flake.nix` file: 3. `$ cargo build --release` 1. cargo build command (release) 2. produces a debug binary in `./target/release/wrapd` -5. in order to use this compiled binary in any location one must add the binary to their $PATH (this is OS specific and not within the scope of this README) - 1. NOTE: This is not an issue if installed using nix, whether that be flakes and NixOS or nix shell +5. in order to use this compiled binary in any location one must add the binary + to their $PATH (this is OS specific and not within the scope of this README) + 1. NOTE: This is not an issue if installed using nix, whether that be flakes + and NixOS or nix shell ## Usage -### When downloading the binary or compiling yourself +### When downloading the binary or compiling yourself + `$ ./{downloaded-binary} {optional-arguments (i.e. --help)}` ### When installed via Nix + `$ wrapd {optional-arguments (i.e. --help)}` ## Optional Arguments (automatically generated by github action) + ``` A command line utility written entirely in Rust that creates tarballs from folders in the current working directory and optionally removes the folders that created those tarballs @@ -89,12 +117,16 @@ nix develop -c cargo run just build ``` -We also provide a [`justfile`](https://just.systems/) for Makefile'esque commands to be run inside of the devShell. -You can run `$ just` inside `$ nix develop` to see all available just outputs +We also provide a [`justfile`](https://just.systems/) for Makefile'esque +commands to be run inside of the devShell. You can run `$ just` inside +`$ nix develop` to see all available just outputs ## Tips - Run `$ just update-flake` to update all flake inputs. - Run `$ just update` to update all flake inputs and cargo dependencies -- Run `nix --accept-flake-config run github:juspay/omnix ci` to build _all_ outputs. -- [pre-commit] hooks will automatically be setup in Nix shell. You can also run `pre-commit run -a` manually to run the hooks (e.g.: to autoformat the project tree using `rustfmt`, `nixpkgs-fmt`, etc.). +- Run `nix --accept-flake-config run github:juspay/omnix ci` to build _all_ + outputs. +- [pre-commit] hooks will automatically be setup in Nix shell. You can also run + `pre-commit run -a` manually to run the hooks (e.g.: to autoformat the project + tree using `rustfmt`, `nixpkgs-fmt`, etc.). diff --git a/nix/modules/devshell.nix b/nix/modules/devshell.nix index fde747e..afa57f1 100644 --- a/nix/modules/devshell.nix +++ b/nix/modules/devshell.nix @@ -17,6 +17,8 @@ wslu cargo-generate python3 + lazygit + gitflow # dotfiles programs inputs.dotfiles.packages.${system}.quick-results @@ -24,7 +26,7 @@ inputs.dotfiles.packages.${system}.cargo-update ]; shellHook = '' - echo "welcome to the rust development environment for the wrap package" | ${pkgs.cowsay}/bin/cowsay + echo "welcome to the rust development environment for the wrap package" | ${pkgs.cowsay}/bin/cowsay | ${pkgs.lolcat}/bin/lolcat 2> /dev/null; ''; }; }; diff --git a/src/main.rs b/src/main.rs index 1876095..b4e8a12 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use tar::Builder; /// Application configuration struct Args { /// Print Verbose output - #[arg(short = 'v')] + #[arg(short = 'v', long = "verbose")] verbose: bool, /// Remove folders after tarballing