File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,19 +16,6 @@ Options:
1616 -h, --help Display help message"
1717}
1818
19- generate_logs_file_path () {
20- local container_log_path=" $1 "
21- shift # This shifts the positional parameters to the left, so $2 becomes $1, $3 becomes $2, etc.
22- local log_files=(" $@ " )
23- local log_file_paths=()
24-
25- for file in " ${log_files[@]} " ; do
26- log_file_paths+=(" $container_log_path$file " )
27- done
28-
29- echo " ${log_file_paths[@]} "
30- }
31-
3219get_all_logs_file_path () {
3320 local logs_location=" $1 "
3421
@@ -38,9 +25,17 @@ get_all_logs_file_path() {
3825if [[ $1 == " -h" || $1 == " --help" ]]; then
3926 display_help
4027elif [[ -z $1 ]]; then
41- mapfile -t all_logs_file_path < <( get_all_logs_file_path " $CONTAINER_LOG_PATH " )
28+ all_logs_file_path=()
29+ while IFS= read -r line; do
30+ all_logs_file_path+=(" $line " )
31+ done < <( get_all_logs_file_path " $CONTAINER_LOG_PATH " )
32+
4233 bin/docker-compose exec phpfpm tail -f " ${all_logs_file_path[@]} "
4334else
44- mapfile -t logs_file_path < <( generate_logs_file_path " $CONTAINER_LOG_PATH " " $@ " )
35+ logs_file_path=()
36+ for file in " $@ " ; do
37+ logs_file_path+=(" ${CONTAINER_LOG_PATH}${file} " )
38+ done
39+
4540 bin/docker-compose exec phpfpm tail -f " ${logs_file_path[@]} "
4641fi
You can’t perform that action at this time.
0 commit comments