Jelajahi Sumber

chore: 1/6 - Inline failure at it's cause

This change has been split into 6 iterative parts/commits to ease the review process.
polarathene 3 tahun lalu
induk
melakukan
8aacd13241
1 mengubah file dengan 5 tambahan dan 6 penghapusan
  1. 5 6
      docker-entrypoint.sh

+ 5 - 6
docker-entrypoint.sh

@@ -41,7 +41,11 @@ if [[ $DOCKER_HOST = unix://* ]]; then
 			Typically you should run your nginxproxy/nginx-proxy with: \`-v /var/run/docker.sock:$socket_file:ro\`
 			See the documentation at http://git.io/vZaGJ
 		EOT
-		socketMissing=1
+		
+		# If the user has run the default command and the socket doesn't exist, fail
+		if [ "$1" = forego ] && [ "$2" = start ] && [ "$3" = '-r' ]; then
+			exit 1
+		fi
 	fi
 fi
 
@@ -61,9 +65,4 @@ elif [[ $RESOLVERS =~ $SCOPED_IPV6_REGEX ]]; then
 	RESOLVERS=$(echo "$RESOLVERS" | sed -r "s/$SCOPED_IPV6_REGEX//g" | xargs echo -n); export RESOLVERS
 fi
 
-# If the user has run the default command and the socket doesn't exist, fail
-if [ "$socketMissing" = 1 ] && [ "$1" = forego ] && [ "$2" = start ] && [ "$3" = '-r' ]; then
-	exit 1
-fi
-
 exec "$@"