forked from craigharman/directus-guest-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.sh
More file actions
executable file
·45 lines (33 loc) · 1.11 KB
/
create.sh
File metadata and controls
executable file
·45 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Check if a project name was provided
if [ -z "$1" ]; then
echo "Usage: $0 project_name"
exit 1
fi
# Set the project name
PROJECT_NAME=$1
# Run the Nuxt installation command
npx nuxi@latest init "$PROJECT_NAME" --packageManager=npm --gitInit=false
# Install the Directus SDK
cd "$PROJECT_NAME" || exit
npm install @directus/sdk
# Copy templates/docker-compose.yml file to the project directory
cp ../templates/docker-compose.yml .
# Make sure docker image is up to date
docker compose pull
# Append `uploads/*` to .gitignore
echo "# Project files" >> .gitignore
echo "uploads/*" >> .gitignore
# Create a .env file with the following contents:
echo "API_URL=http://0.0.0.0:8055" > .env
# Overwrite Nuxt config file with the following contents
cp ../templates/nuxt.config.ts nuxt.config.ts
# Create directus.d.ts file
cp ../templates/directus.d.ts directus.d.ts
# Make the Directus plugin
mkdir plugins
cp ../templates/directus.plugin.ts plugins/directus.ts
# Change app.vue to use page routing
cp ../templates/app.vue .
echo ""
echo "Project '$PROJECT_NAME' has been created and is ready for article writing!"