automatically pull from git in upd alias

This commit is contained in:
cswimr 2025-01-23 16:08:42 -06:00
parent 3c9490fe52
commit 0280981e32
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -55,6 +55,11 @@ def _upd(args: list):
"Visual Studio Code user settings": ".config/Code/User/settings.json.bak",
"fontconfig": ".config/fontconfig/conf.d/10-hm-fonts.conf.bak"
}
if not "--no-pull" in args:
print(f"{c.BLUE}Pulling {c.YELLOW}NixOS{c.BLUE} configuration from remote{c.END}")
run["git", "pull", cwd=path]
else:
args.remove("--no-pull")
if "--rewrite-hardware-configuration" in args:
args.remove("--rewrite-hardware-configuration")
print(f"{c.BLUE}Updating {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE}{c.END}")