Skip to content

Commit

Permalink
Merge pull request #61 from willbush/use-cargo-edit-upgrade
Browse files Browse the repository at this point in the history
Switch to using `cargo-edit` for `cargo upgrade` command
  • Loading branch information
philiptaron authored May 8, 2024
2 parents 60bbcb5 + 3afd88d commit 23aca77
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ let
env.RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
inputsFrom = [ packages.build ];
nativeBuildInputs = with pkgs; [
cargo-edit
npins
rust-analyzer
treefmtEval.config.build.wrapper
Expand Down Expand Up @@ -95,13 +96,18 @@ let
};
cargo = pkgs.writeShellApplication {
name = "update-cargo";
runtimeInputs = with pkgs; [ cargo ];
runtimeInputs = with pkgs; [
cargo
cargo-edit
];
text = ''
echo "<details><summary>cargo changes</summary>"
# Needed because GitHub's rendering of the first body line breaks down otherwise
echo ""
# Note: `cargo upgrade` is a subcommand provided by `cargo-edit`.
# --incompatible allows jumping to the next major version.
echo '```'
cargo update --manifest-path "$1/Cargo.toml" 2>&1
cargo upgrade --incompatible --manifest-path "$1/Cargo.toml" 2>&1
echo '```'
echo "</details>"
'';
Expand Down

0 comments on commit 23aca77

Please sign in to comment.