Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Commit 5487312

Browse files
committed
Properly handle CLI options that imply --run
1 parent d3b757d commit 5487312

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

root/etc/s6-overlay/s6-rc.d/init-pmm-oneshot/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ IFS="|" read -r -a CLI_OPTIONS <<< "$CLI_OPTIONS_STRING"
55
cd / || exit 1
66

77
# halt startup if no config file is found
8-
if [[ -n ${PMM_CONFIG} ]]; then
9-
CONFIG_FILE=${PMM_CONFIG}
8+
if [[ -n "${PMM_CONFIG}" ]]; then
9+
CONFIG_FILE="${PMM_CONFIG}"
1010
elif echo "${CLI_OPTIONS[@]}" | grep -qPo '([\s]|^)(--config|-c)([\s])(.+\/[^\/]+)\.(yml|yaml)'; then
1111
CONFIG_FILE=$(echo "${CLI_OPTIONS[@]}" | grep -Po '([\s]|^)(--config|-c)([\s])\K(.+\/[^\/]+)\.(yml|yaml)')
1212
else

root/etc/s6-overlay/s6-rc.d/svc-pmm/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ IFS="|" read -r -a CLI_OPTIONS <<< "$CLI_OPTIONS_STRING"
55
cd / || exit 1
66

77
# halt startup if no config file is found
8-
if [[ -n ${PMM_CONFIG} ]]; then
9-
CONFIG_FILE=${PMM_CONFIG}
8+
if [[ -n "${PMM_CONFIG}" ]]; then
9+
CONFIG_FILE="${PMM_CONFIG}"
1010
elif echo "${CLI_OPTIONS[@]}" | grep -qPo '([\s]|^)(--config|-c)([\s])(.+\/[^\/]+)\.(yml|yaml)'; then
1111
CONFIG_FILE=$(echo "${CLI_OPTIONS[@]}" | grep -Po '([\s]|^)(--config|-c)([\s])\K(.+\/[^\/]+)\.(yml|yaml)')
1212
else

root/init-hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
IFS="|" read -r -a CLI_OPTIONS <<< "$CLI_OPTIONS_STRING"
44

5-
if [[ $(tr "[:upper:]" "[:lower:]" <<<"${PMM_RUN}") = "true" ]] || echo "${CLI_OPTIONS[@]}" | grep -qPo '([\s]|^)(--run|-r)([\s]|$)'; then
5+
if [[ $(tr "[:upper:]" "[:lower:]" <<<"${PMM_RUN}") = "true" ]] || echo "${CLI_OPTIONS[@]}" | grep -qPo '([\s]|^)(--run|--tests|--run-tests|--run-collections|--run-libraries|--run-metadata-files|--resume|-r|-rm|-rl|-rc|-rt|re)([\s]|$)'; then
66
rm -rf /etc/s6-overlay/s6-rc.d/svc-pmm
77
rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/svc-pmm
88
rm -rf /etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-pmm-config

0 commit comments

Comments
 (0)