diff --git a/justfile b/justfile index 292f2d5..4a33108 100644 --- a/justfile +++ b/justfile @@ -23,6 +23,26 @@ show-nvim-logs: test: nix develop --command bash -c 'go test ./... -count=1' +[working-directory: "./server"] +update-antlr-parsers: + # aliases + cd handlers/aliases && antlr4 -Dlanguage=Go -o ast/parser Aliases.g4 + + # fstab + cd handlers/fstab && antlr4 -Dlanguage=Go -o ast/parser Fstab.g4 + + # sshd_config + cd handlers/sshd_config && antlr4 -Dlanguage=Go -o ast/parser Config.g4 + cd handlers/sshd_config/match-parser && antlr4 -Dlanguage=Go -o parser Match.g4 + + # ssh_config + cd handlers/ssh_config && antlr4 -Dlanguage=Go -o ast/parser Config.g4 + cd handlers/ssh_config/match-parser && antlr4 -Dlanguage=Go -o parser Match.g4 + + # hosts + cd handlers/hosts && antlr4 -Dlanguage=Go -o ast/parser Hosts.g4 + + # Ready for a PR? Run this recipe before opening the PR! ready: just lint diff --git a/server/update_antlr_parser.sh b/server/update_antlr_parser.sh deleted file mode 100755 index 9534937..0000000 --- a/server/update_antlr_parser.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -ROOT=$(git rev-parse --show-toplevel)/server - -# aliases -cd $ROOT/handlers/aliases && antlr4 -Dlanguage=Go -o ast/parser Aliases.g4 - -# fstab -cd $ROOT/hanlders/fstab && antlr4 -Dlanguage=Go -o ast/parser Fstab.g4 - -# sshd_config -cd $ROOT/handlers/sshd_config && antlr4 -Dlanguage=Go -o ast/parser Config.g4 -cd $ROOT/handlers/sshd_config/match-parser && antlr4 -Dlanguage=Go -o parser Match.g4 - -# ssh_config -cd $ROOT/handlers/ssh_config && antlr4 -Dlanguage=Go -o ast/parser Config.g4 -cd $ROOT/handlers/ssh_config/match-parser && antlr4 -Dlanguage=Go -o parser Match.g4 - -# hosts -cd $ROOT/handlers/hosts && antlr4 -Dlanguage=Go -o ast/parser Hosts.g4 -