chore: Move antlr update script into folder

This commit is contained in:
Myzel394 2024-10-03 17:45:49 +02:00
parent 4dc259db33
commit 7e5d8d115a
No known key found for this signature in database
GPG Key ID: DEC4AAB876F73185
3 changed files with 19 additions and 18 deletions

View File

@ -44,6 +44,7 @@
buildInputs = inputs ++ (with pkgs; [
mailutils
wireguard-tools
antlr
]) ++ (if pkgs.stdenv.isLinux then with pkgs; [
postfix
] else []);

18
server/update_antlr_parser.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
ROOT=$(git rev-parse --show-toplevel)/server
# aliases
cd $ROOT/handlers/aliases && antlr4 -Dlanguage=Go -o ast/parser Aliases.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

View File

@ -1,18 +0,0 @@
#!/bin/sh
GIT_ROOT=$(git rev-parse --show-toplevel)
# aliases
cd $GIT_ROOT/handlers/aliases && antlr4 -Dlanguage=Go -o ast/parser Aliases.g4
# sshd_config
cd $GIT_ROOT/handlers/sshd_config && antlr4 -Dlanguage=Go -o ast/parser Config.g4
cd $GIT_ROOT/handlers/sshd_config/match-parser && antlr4 -Dlanguage=Go -o parser Match.g4
# ssh_config
cd $GIT_ROOT/handlers/ssh_config && antlr4 -Dlanguage=Go -o ast/parser Config.g4
cd $GIT_ROOT/handlers/ssh_config/match-parser && antlr4 -Dlanguage=Go -o parser Match.g4
# hosts
cd $GIT_ROOT/handlers/hosts && antlr4 -Dlanguage=Go -o ast/parser Hosts.g4