Skip to content

Commit

Permalink
Do not add hosts entries for files on vvv_update_guest_hosts if the d…
Browse files Browse the repository at this point in the history
…omain is already present
  • Loading branch information
tomjn authored Jun 13, 2024
1 parent c425018 commit 1b8adb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion provision/provision-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,10 @@ function vvv_update_guest_hosts() {
local value
value=$(shyaml -q get-values "sites.${SITE_ESCAPED}.hosts" <${VVV_CONFIG})
for v in $value; do
echo "127.0.0.1 ${v:-"${VVV_SITE_NAME}.test"}" >> /tmp/site-hosts
if [[ -z "$(grep -q "^127.0.0.1 ${v:-"${VVV_SITE_NAME}.test"}$" /etc/hosts)" ]]; then
echo "127.0.0.1 ${v:-"${VVV_SITE_NAME}.test"} # vvv-auto" >> "/etc/hosts"
echo "::1 ${v:-"${VVV_SITE_NAME}.test"} # vvv-auto" >> "/etc/hosts"
fi
done
done

Expand Down

0 comments on commit 1b8adb0

Please sign in to comment.