From d65b8253165f49351f952117989041864cbe4138 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 24 Jun 2025 14:19:03 +0200 Subject: [PATCH] Add execInDir function --- php/includes/functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/includes/functions.php b/php/includes/functions.php index 5187a70..80c7a32 100644 --- a/php/includes/functions.php +++ b/php/includes/functions.php @@ -16,4 +16,9 @@ function line(string $line): void { line($line); exit($code); -} \ No newline at end of file +} + +function execInDirectory(string $dir, string $command): ?string +{ + return shell_exec(sprintf('cd %s && %s', $dir, $command)); +}