andir / npins

Nix dependency pinning. Very similar to Niv but has a few features that I personally wanted.
European Union Public License 1.2
199 stars 16 forks source link

Be more verbose in all commands #16

Closed gilligan closed 2 years ago

gilligan commented 2 years ago

Print some brief output for the success case of all commands.

Notes

TODOs In case of the add command i am printing a Pin but the the Display implementation isn't exactly pretty and shouldn't be shown to the user like that. The implementation is part of the mkPin macro. I guess the different pin types need custom implementations at which point the macro would probably not make sense anymore?


npins init

$ npins init -d /tmp/npins
Successfully written initial files to '/tmp/npins'

npins add

$ npins add github nix-community npmlock2nix
Successfully added pin for 'PinInput { repository: "npmlock2nix", owner: "nix-community", branch: "master" } -> Some(PinOutput { revision: "ff17a3c59233911f776d8d462d61d82a3e41df34", hash: "0l624gkkpn1r0g48b204k0wcqm9cwy5rzd5mnxwfjhyjj1wg4nl7" })'.

npins update

$ npins update
Updating nixpkgs ...
changes:
revision:
        - "8f39ad3da14ce78daf249c8291a4e43a17bbcf98"
        + "5c37ad87222cfc1ec36d6cd1364514a9efc2f7f2"

hash:
        - "1sdfb6bq8n0v5m6962cz5nfw3hkcrlzc1xnw6b0xnkr3sxxj6m34"
        + "1r74afnalgcbpv7b9sbdfbnx1kfj0kp1yfa60bbbv27n36vqdhbb"

Updating npmlock2nix ...
Updating pre-commit-hooks.nix ...
changes:
revision:
        - "433808cba23975201a48a3bb8ebc76029191fafd"
        + "ff9c0b459ddc4b79c06e19d44251daa8e9cd1746"

hash:
        - "17a21w3l2z1ng36f37rxv8bw3sy7qppyf1yzsqgy88f98fs0r4il"
        + "0z09ndxvbk6w4j28lzgj0b9qqcbwrvr58c0xsm0rf0xsdipi0nwf"

Update successful.

npins update

$ npins update nixpkgs
Updating nixpkgs ...
Update successful.

npins remove

$ npins remove nixpkgs
Successfully removed pin for 'nixpkgs'.
piegamesde commented 2 years ago

Superseded by #23.

I tried to incorporate as many changes from here as possible, if I missed any please let me know or simply open a new pull request.