"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateDockerSh = generateDockerSh;
function generateDockerSh({ schema: { projectType, slug } }) {
    const mountPath = projectType === 'workspace' ? '../../' : '${PWD}';
    const workDir = projectType === 'workspace' ? `/pxl/projects/${slug}/e2e` : '/pxl/e2e';
    return /*sh*/ String.raw `#!/bin/bash
# This script should only be run via 'pnpm docker' in the project root!
# Define a name for the image
IMAGE_NAME="e2e-pxl-env"

# Build the image from the Dockerfile in the current directory
docker build -t $IMAGE_NAME ./e2e/

# Run a container from the built image
# Add user mapping only on Linux/WSL to avoid permission issues with mounted volumes
USER_FLAG=""
if [[ "$(uname)" = "Linux" ]]; then
    USER_FLAG="-u $(id -u):$(id -g)"
fi
${projectType === 'workspace' ? '# Mount the entire monorepo to preserve pnpm workspace symlinks' : ''}
docker run -p 3030:3030 $USER_FLAG -v ${mountPath}:/pxl -w ${workDir} --rm -it $IMAGE_NAME /bin/bash
`;
}
//# sourceMappingURL=docker-sh.generator.js.map