Skip to content

Commit 28d82ae

Browse files
authored
remove process substitution in while loops (#217)
This commit removes the process substitution from while loops as that leads to problems in shared hosting environments where the user does not have access to `/dev` or `/proc`. Piping into the while loop is functionally identical in this case and does not lead to these problems.
1 parent a5f0725 commit 28d82ae

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

shopware/administration/6.7/bin/build-administration.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if [[ $(command -v jq) ]]; then
5555

5656
basePaths=()
5757

58-
while read -r config; do
58+
jq -c '.[]' "var/plugins.json" | while read -r config; do
5959
srcPath=$(echo "$config" | jq -r '(.basePath + .administration.path)')
6060
basePath=$(echo "$config" | jq -r '.basePath')
6161

@@ -78,7 +78,7 @@ if [[ $(command -v jq) ]]; then
7878

7979
(cd "$path" && npm install --omit=dev --no-audit --prefer-offline)
8080
fi
81-
done < <(jq -c '.[]' "var/plugins.json")
81+
done
8282

8383
for basePath in "${basePaths[@]}"; do
8484
if [[ -r "${basePath}/package.json" ]]; then

shopware/platform/6.7/bin/build-administration.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if [[ $(command -v jq) ]]; then
5555

5656
basePaths=()
5757

58-
while read -r config; do
58+
jq -c '.[]' "var/plugins.json" | while read -r config; do
5959
srcPath=$(echo "$config" | jq -r '(.basePath + .administration.path)')
6060
basePath=$(echo "$config" | jq -r '.basePath')
6161

@@ -78,7 +78,7 @@ if [[ $(command -v jq) ]]; then
7878

7979
(cd "$path" && npm install --omit=dev --no-audit --prefer-offline)
8080
fi
81-
done < <(jq -c '.[]' "var/plugins.json")
81+
done
8282

8383
for basePath in "${basePaths[@]}"; do
8484
if [[ -r "${basePath}/package.json" ]]; then

shopware/platform/6.7/bin/build-storefront.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [[ $(command -v jq) ]]; then
3636
cd "$PROJECT_ROOT" || exit
3737
basePaths=()
3838

39-
while read -r config; do
39+
jq -c '.[]' "var/plugins.json" | while read -r config; do
4040
srcPath=$(echo "$config" | jq -r '(.basePath + .storefront.path)')
4141
basePath=$(echo "$config" | jq -r '.basePath')
4242

@@ -59,7 +59,7 @@ if [[ $(command -v jq) ]]; then
5959

6060
(cd "$path" && npm install --prefer-offline)
6161
fi
62-
done < <(jq -c '.[]' "var/plugins.json")
62+
done
6363

6464
for basePath in "${basePaths[@]}"; do
6565
if [[ -r "${basePath}/package.json" ]]; then

shopware/storefront/6.7/bin/build-storefront.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [[ $(command -v jq) ]]; then
3636
cd "$PROJECT_ROOT" || exit
3737
basePaths=()
3838

39-
while read -r config; do
39+
jq -c '.[]' "var/plugins.json" | while read -r config; do
4040
srcPath=$(echo "$config" | jq -r '(.basePath + .storefront.path)')
4141
basePath=$(echo "$config" | jq -r '.basePath')
4242

@@ -60,7 +60,7 @@ if [[ $(command -v jq) ]]; then
6060

6161
(cd "$path" && npm install --prefer-offline)
6262
fi
63-
done < <(jq -c '.[]' "var/plugins.json")
63+
done
6464

6565
for basePath in "${basePaths[@]}"; do
6666
if [[ -r "${basePath}/package.json" ]]; then

0 commit comments

Comments
 (0)