Commit cd71d9cc authored by Pablo Armingol's avatar Pablo Armingol Committed by Samuel Santos
Browse files

feat: Copy .env if not exists

parent 20cacd6f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -43,9 +43,14 @@ if [ ! -f src/config/.env.example ]; then
    exit 1
fi

# Copy .env.example to .env
echo "Generating .env file..."
# Copy .env if not exists
if [ -f src/config/.env ]; then
    echo "Using existing src/config/.env file..."
    cp src/config/.env .env
else
    echo "Generating .env file from example..."
    cp src/config/.env.example .env
fi

# Read NSC_PORT from .env
NSC_PORT=$(grep '^NSC_PORT=' .env | cut -d '=' -f2)