feat(Justfile): Add comments and update ast-grep pattern for program addition
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
This commit is contained in:
3
justfile
3
justfile
@@ -34,8 +34,9 @@ rollback:
|
|||||||
|
|
||||||
add program:
|
add program:
|
||||||
echo '{pkgs, ...}: { home.packages = [pkgs.{{program}}];}' > home/programs/{{program}}.nix
|
echo '{pkgs, ...}: { home.packages = [pkgs.{{program}}];}' > home/programs/{{program}}.nix
|
||||||
|
# https://ast-grep.github.io/advanced/pattern-parse.html#incomplete-pattern-code
|
||||||
|
# Since the imports doesn't match the whole pattern we need to use the selector binding and the attr expression to match it properly.
|
||||||
ast-grep run -p '{ imports = [$$$ITEMS] }' --selector binding --rewrite 'imports = [$$$ITEMS ./{{program}}.nix ]' home/programs/default.nix -i
|
ast-grep run -p '{ imports = [$$$ITEMS] }' --selector binding --rewrite 'imports = [$$$ITEMS ./{{program}}.nix ]' home/programs/default.nix -i
|
||||||
alejandra fmt home/programs/{{program}}.nix home/programs/default.nix
|
alejandra fmt home/programs/{{program}}.nix home/programs/default.nix
|
||||||
git add home/programs/{{program}}.nix
|
git add home/programs/{{program}}.nix
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user