Skip to content

Commit 123c15a

Browse files
committed
post-import-db.d run hooks scheme
1 parent 262d8c4 commit 123c15a

File tree

9 files changed

+39
-1
lines changed

9 files changed

+39
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: pimp-my-shell
22
repository: .
33
version: ""
4-
install_date: "2024-03-26T19:27:47-03:00"
4+
install_date: "2024-03-28T11:06:50-03:00"
55
project_files:
66
- web-build/Dockerfile.pimp-my-shell
77
- homeadditions/.bashrc.d/pimp-my-shell.sh
@@ -10,5 +10,8 @@ project_files:
1010
- commands/web/gum
1111
- homeadditions/.local/share/bash-completion/completions/ahoy
1212
- homeadditions/.config/starship.toml
13+
- pimp-my-shell/hooks/README.md
14+
- pimp-my-shell/hooks/post-import-db.sh
15+
- pimp-my-shell/hooks/post-import-db.d
1316
global_files: []
1417
removal_actions: []

.ddev/config.pimp-my-shell.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#ddev-generated
2+
hooks:
3+
post-import-db:
4+
- exec: /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.sh
25
webimage_extra_packages:
36
- bash-completion
47
- boxes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#ddev-generated
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
#ddev-generated
3+
set -e -o pipefail
4+
5+
for f in /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.d/*; do
6+
if [ -x $f ]; then
7+
$f;
8+
fi
9+
done

config.pimp-my-shell.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#ddev-generated
2+
hooks:
3+
post-import-db:
4+
- exec: /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.sh
25
webimage_extra_packages:
36
- bash-completion
47
- boxes

install.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ project_files:
77
- commands/web/gum
88
- homeadditions/.local/share/bash-completion/completions/ahoy
99
- homeadditions/.config/starship.toml
10+
- pimp-my-shell/hooks/README.md
11+
- pimp-my-shell/hooks/post-import-db.sh
12+
- pimp-my-shell/hooks/post-import-db.d

pimp-my-shell/hooks/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- #ddev-generated -->
2+
The idea for directory is to provide a way for another addons to register hook
3+
scripts. This is very similar to adding it to config.yaml, only that this exists
4+
so that this scripts can be called from within ddev itself. For now this makes
5+
sense for post-import-db hooks were one might have a locally defined import
6+
method and/or script.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#ddev-generated

pimp-my-shell/hooks/post-import-db.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
#ddev-generated
3+
set -e -o pipefail
4+
5+
for f in /var/www/html/.ddev/pimp-my-shell/hooks/post-import-db.d/*; do
6+
if [ -x $f ]; then
7+
$f;
8+
fi
9+
done

0 commit comments

Comments
 (0)