File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 77# ## ON IMPORT COMPLETE EVENT TYPE IN YOUR SONARR SETTINGS
88
99# Load environment variables from .env file if it exists
10- if [ -f " .env" ]; then
10+ # in the same directory as this bash script
11+
12+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
13+ ENV_PATH=" $SCRIPT_DIR /.env"
14+ if [ -f " $ENV_PATH " ]; then
1115 # shellcheck source=.env
12- echo " Loading environment variables from .env file"
13- source " .env "
16+ echo " Loading environment variables from $ENV_PATH file"
17+ source " $ENV_PATH "
1418 if [ $? -eq 0 ]; then
1519 echo " Environment variables loaded successfully"
1620 else
1721 echo " Error loading environment variables" >&2
1822 exit 1
1923 fi
2024else
21- echo " .env file not found"
25+ echo " .env file not found in script directory ( $ENV_PATH ) "
2226fi
2327
2428# Use environment variables with descriptive default values
@@ -86,7 +90,7 @@ detect_application() {
8690 folderPath=" $sonarr_episodefile_sourcefolder "
8791 }
8892 # shellcheck disable=SC2154 # These are set by Starr on call
89- filePath=" $sonarr_episodefile_paths "
93+ filePath=" $sonarr_episodefile_path "
9094 fi
9195 # shellcheck disable=SC2154 # These are set by Starr on call
9296 eventType=" $sonarr_eventtype "
You can’t perform that action at this time.
0 commit comments