28 lines
526 B
Bash
Executable File
28 lines
526 B
Bash
Executable File
#!/bin/bash
|
|
fail() {
|
|
echo "$*" >&2
|
|
exit 1
|
|
}
|
|
|
|
declare project_type=$1
|
|
declare project=$2
|
|
|
|
if [[ "${project}" == "" ]] || [[ "${project_type}" == "" ]]; then
|
|
echo "usage: ./launch expo|flutter PROJECT" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -d "projects/${project}" ]]; then
|
|
if ! mkdir -p "projects/${project}"; then
|
|
fail "mkdir -p projects/${project}"
|
|
fi
|
|
fi
|
|
declare full_path=$(realpath "projects/${project}")
|
|
|
|
if ! docker compose exec -it \
|
|
"${project}" \
|
|
shell; then
|
|
fail "Unable to launch shell in ${project}"
|
|
fi
|
|
|