-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreate
More file actions
19 lines (15 loc) · 549 Bytes
/
create
File metadata and controls
19 lines (15 loc) · 549 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
echo $1 | grep -E -q '^[A-Za-z_.-]+$' || die "Application name is required, allowed characrs are A-Z a-z _ . -, $1 provided"
if [ -d "$1" ]; then
# Take action if $DIR exists. #
die "Folder $1 alread exists."
fi
mkdir $1
cd $1
docker run --rm --volume $(pwd):/app ghcr.io/maymeow/php-ci-cd/php-ci-cd:8.0.2-cs-git sh -c "composer create-project --prefer-dist maymeow/cakephp-starter-kit:dev-main /app"
sudo chown -R $USER:$GID .