mirror of
https://github.com/shadoll/just-commons.git
synced 2026-08-28 03:27:10 +00:00
Refactor: Update project name detection to include 'container' directory for Docker and Containerfile
This commit is contained in:
@@ -21,7 +21,7 @@ _get_project_name:
|
|||||||
project_name=""
|
project_name=""
|
||||||
|
|
||||||
# Check if we're in root with single Containerfile
|
# Check if we're in root with single Containerfile
|
||||||
if [ -f "Containerfile" ] || [ -f "Dockerfile" ] || [ -f "docker/Containerfile" ] || [ -f "docker/Dockerfile" ]; then
|
if [ -f "Containerfile" ] || [ -f "Dockerfile" ] || [ -f "container/Containerfile" ] || [ -f "container/Dockerfile" ] || [ -f "docker/Containerfile" ] || [ -f "docker/Dockerfile" ]; then
|
||||||
# Check for multiple projects (subdirectories with Containerfiles)
|
# Check for multiple projects (subdirectories with Containerfiles)
|
||||||
subproject_count=0
|
subproject_count=0
|
||||||
for dir in */; do
|
for dir in */; do
|
||||||
@@ -143,7 +143,12 @@ _discover_containerfile_in dir="":
|
|||||||
echo "$dir/Containerfile $(basename $(realpath $dir)) $dir/"
|
echo "$dir/Containerfile $(basename $(realpath $dir)) $dir/"
|
||||||
elif [ -f "$dir/Dockerfile" ]; then
|
elif [ -f "$dir/Dockerfile" ]; then
|
||||||
echo "$dir/Dockerfile $(basename $(realpath $dir)) $dir/"
|
echo "$dir/Dockerfile $(basename $(realpath $dir)) $dir/"
|
||||||
# Check ./docker folder (only when dir is current directory)
|
# Check ./container folder (only when dir is current directory)
|
||||||
|
elif [ "$dir" = "." ] && [ -f "container/Containerfile" ]; then
|
||||||
|
echo "container/Containerfile $(basename $(pwd)) ."
|
||||||
|
elif [ "$dir" = "." ] && [ -f "container/Dockerfile" ]; then
|
||||||
|
echo "container/Dockerfile $(basename $(pwd)) ."
|
||||||
|
# Backward compatibility with older projects
|
||||||
elif [ "$dir" = "." ] && [ -f "docker/Containerfile" ]; then
|
elif [ "$dir" = "." ] && [ -f "docker/Containerfile" ]; then
|
||||||
echo "docker/Containerfile $(basename $(pwd)) ."
|
echo "docker/Containerfile $(basename $(pwd)) ."
|
||||||
elif [ "$dir" = "." ] && [ -f "docker/Dockerfile" ]; then
|
elif [ "$dir" = "." ] && [ -f "docker/Dockerfile" ]; then
|
||||||
@@ -153,6 +158,8 @@ _discover_containerfile_in dir="":
|
|||||||
if [ "$dir" = "." ]; then
|
if [ "$dir" = "." ]; then
|
||||||
echo " - ./Containerfile" >&2
|
echo " - ./Containerfile" >&2
|
||||||
echo " - ./Dockerfile" >&2
|
echo " - ./Dockerfile" >&2
|
||||||
|
echo " - ./container/Containerfile" >&2
|
||||||
|
echo " - ./container/Dockerfile" >&2
|
||||||
echo " - ./docker/Containerfile" >&2
|
echo " - ./docker/Containerfile" >&2
|
||||||
echo " - ./docker/Dockerfile" >&2
|
echo " - ./docker/Dockerfile" >&2
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user