From c4870e49cf971e008502d601ea0bf6caa6868845 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 7 Dec 2024 15:53:17 -0500 Subject: [PATCH] Ensure All commands are executed within the update and setup scripts directory --- setup_cli.php | 3 +++ update_cli.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/setup_cli.php b/setup_cli.php index 53b04b9d..cf42996c 100644 --- a/setup_cli.php +++ b/setup_cli.php @@ -5,6 +5,9 @@ //php setup_cli.php --help //php setup_cli.php --host=localhost --username=itflow --password=secret --database=itflow --base-url=example.com/itflow --locale=en_US --timezone=UTC --currency=USD --company-name="My Company" --country="United States" --user-name="John Doe" --user-email="john@example.com" --user-password="admin123" --non-interactive +// Change to the directory of this script so that all shell commands run here +chdir(__DIR__); + // Ensure we're running from command line if (php_sapi_name() !== 'cli') { die("This setup script must be run from the command line.\n"); diff --git a/update_cli.php b/update_cli.php index 3bace1b8..b70dc0e9 100644 --- a/update_cli.php +++ b/update_cli.php @@ -1,6 +1,9 @@ #!/usr/bin/env php