1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files

35 lines
820 B
Nix
Raw Permalink Normal View History

2019-06-08 14:53:12 +02:00
{ lib, writeShellScriptBin }:
let
2019-07-09 22:54:43 +02:00
aliasFlag = name: value: "-c alias.${name}=${lib.escapeShellArg value}";
2019-06-08 14:53:12 +02:00
aliases = {
eroeffne = "init";
machnach = "clone";
zieh = "pull";
fueghinzu = "add";
drueck = "push";
pfusch = "push --force";
zweig = "branch";
verzweige = "branch";
uebergib = "commit";
erde = "rebase";
unterscheide = "diff";
vereinige = "merge";
bunkere = "stash";
markiere = "tag";
nimm = "checkout";
tagebuch = "log";
zustand = "status";
};
in writeShellScriptBin "depp" ''
if [ $# -gt 0 ]; then
2020-06-10 17:37:25 +02:00
git ${
lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)
} "$@"
2019-06-08 14:53:12 +02:00
else
2020-06-10 17:37:25 +02:00
printf "${
lib.concatStringsSep "\n"
(lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)
}\n"
2019-06-08 14:53:12 +02:00
fi
''