-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.yaml
More file actions
71 lines (64 loc) · 2.41 KB
/
Copy pathinstall.yaml
File metadata and controls
71 lines (64 loc) · 2.41 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: ddev-nextcloud-app
pre_install_actions:
- |
#ddev-description: Validate the Nextcloud app project layout
if [ "${DDEV_PROJECT_TYPE}" != "php" ]; then
echo "ddev-nextcloud-app requires project type 'php'."
echo "Current project type: '${DDEV_PROJECT_TYPE}'."
echo "Run: ddev config --project-type=php --docroot=nextcloud"
echo "Then: ddev config --webserver-type=apache-fpm"
exit 1
fi
if [ "${DDEV_DOCROOT}" != "nextcloud" ]; then
echo "ddev-nextcloud-app requires docroot 'nextcloud' (current: '${DDEV_DOCROOT}')."
echo "Run: ddev config --docroot=nextcloud"
exit 1
fi
if [ ! -f "${DDEV_APPROOT}/appinfo/info.xml" ]; then
echo "appinfo/info.xml was not found in ${DDEV_APPROOT}."
echo "Install this add-on from the root of a Nextcloud app repository."
exit 1
fi
project_files:
- commands/web/cron
- commands/web/nc-app-exec
- commands/web/nc-link
- commands/web/nc-setup
- commands/web/occ
- config.nextcloud-app.yaml
- nextcloud-app/ddev.config.php
- nextcloud-app/lib.sh
ddev_version_constraint: '>= v1.24.10'
post_install_actions:
- |
#ddev-description: Ignore the generated Nextcloud core worktree
gitignore="${DDEV_APPROOT}/.gitignore"
marker="# BEGIN ddev-nextcloud-app"
if [ ! -f "${gitignore}" ] || ! grep -Fq "${marker}" "${gitignore}"; then
{
printf '\n%s\n' "${marker}"
printf '/nextcloud/\n'
printf '# END ddev-nextcloud-app\n'
} >> "${gitignore}"
fi
removal_actions:
- |
#ddev-description: Remove the generated Git ignore block
gitignore="${DDEV_APPROOT}/.gitignore"
if [ -f "${gitignore}" ]; then
if grep -Fqx "# BEGIN ddev-nextcloud-app" "${gitignore}" \
&& grep -Fqx "# END ddev-nextcloud-app" "${gitignore}"; then
temporary="${gitignore}.ddev-nextcloud-app.tmp"
awk '
$0 == "# BEGIN ddev-nextcloud-app" { skipping = 1; next }
$0 == "# END ddev-nextcloud-app" { skipping = 0; next }
!skipping { print }
' "${gitignore}" > "${temporary}"
mv "${temporary}" "${gitignore}"
elif grep -Fq "ddev-nextcloud-app" "${gitignore}"; then
echo "略過已被修改的 ddev-nextcloud-app Git ignore 區塊。"
fi
fi
if [ -d "${DDEV_APPROOT}/nextcloud" ]; then
echo "保留 ${DDEV_APPROOT}/nextcloud;確認不再需要後可由使用者自行移除。"
fi