Add `get-tags` and `count-tags` scripts to get and count Git tags within a repository, including the ability to filter tags - e.g. only get or count tags that begin with a certain date.
This commit is contained in:
parent
559d5239c5
commit
adfe90c99b
5 changed files with 39 additions and 0 deletions
|
@ -38,7 +38,9 @@
|
|||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
count-tags
|
||||
create-script
|
||||
get-tags
|
||||
tag-release
|
||||
time-until
|
||||
update-all-git-repos
|
||||
|
|
|
@ -99,8 +99,10 @@
|
|||
home.packages = with pkgs; [
|
||||
backup-websites
|
||||
build-glove80
|
||||
count-tags
|
||||
create-script
|
||||
displayselect
|
||||
get-tags
|
||||
qrencode
|
||||
mounter
|
||||
move-firefox-screenshots
|
||||
|
|
14
packages/count-tags.nix
Executable file
14
packages/count-tags.nix
Executable file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "count-tags";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
get-tags
|
||||
];
|
||||
|
||||
text = ''
|
||||
get-tags "''${1:-}" | wc -l
|
||||
'';
|
||||
}
|
|
@ -9,9 +9,11 @@ in
|
|||
_timer = callPackage ./_timer.nix { };
|
||||
backup-websites = callPackage ./backup-websites.nix { };
|
||||
build-glove80 = callPackage ./build-glove80.nix { };
|
||||
count-tags = callPackage ./count-tags.nix { };
|
||||
create-script = callPackage ./create-script.nix { };
|
||||
dev-commit = callPackage ./dev-commit.nix { };
|
||||
displayselect = callPackage ./displayselect { };
|
||||
get-tags = callPackage ./get-tags.nix { };
|
||||
git-graph = callPackage ./git-graph.nix { };
|
||||
mounter = callPackage ./mounter.nix { };
|
||||
move-firefox-screenshots = callPackage ./move-firefox-screenshots.nix { };
|
||||
|
|
19
packages/get-tags.nix
Executable file
19
packages/get-tags.nix
Executable file
|
@ -0,0 +1,19 @@
|
|||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "get-tags";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
git
|
||||
unixtools.column
|
||||
];
|
||||
|
||||
text = ''
|
||||
if [[ "$#" -gt 0 ]]; then
|
||||
git tag | grep "$*"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git tag
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue