@@ -3,15 +3,15 @@ set -o errexit -o errtrace -o noclobber -o nounset -o pipefail
3
3
IFS=$' \n\t '
4
4
5
5
script_dir=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
6
- project_dir=$( cd " $( dirname " $script_dir " ) " && pwd)
6
+ project_dir=$( cd " $( dirname " $script_dir " ) /.. " && pwd)
7
7
8
8
cd " $project_dir " || exit
9
9
10
10
# String type (drupal or symfony) from start of name
11
11
function strip-project-type() {
12
12
name=$1
13
13
14
- if [[ " $name " =~ ^(drupal- | symfony-) (.+) ]]; then
14
+ if [[ " $name " =~ ^(drupal| symfony)/ (.+) ]]; then
15
15
name=" ${BASH_REMATCH[2]} "
16
16
fi
17
17
@@ -36,19 +36,19 @@ for template_dir in templates/*; do
36
36
exit 1
37
37
fi
38
38
39
- for f in github/workflows/* .yaml; do
40
- file_name=$( basename " $f " )
39
+ for f in $( find github/workflows/ -name ' *.yaml' | sort) ; do
41
40
source_file_name=' '
42
- if [[ " $file_name " =~ ^drupal- ]]; then
41
+ # Note: / is NOT a regex delimiter here, but an actual /, i.e. a directory separator.
42
+ if [[ " $f " =~ /drupal/ ]]; then
43
43
if [[ " $project_type " == " drupal" ]]; then
44
- source_file_name=" $file_name "
44
+ source_file_name=" $( basename $( dirname " $f " ) ) / $( basename " $f " ) "
45
45
fi
46
- elif [[ " $file_name " =~ ^ symfony- ]]; then
46
+ elif [[ " $f " =~ / symfony/ ]]; then
47
47
if [[ " $project_type " == " symfony" ]]; then
48
- source_file_name=" $file_name "
48
+ source_file_name=" $( basename $( dirname " $f " ) ) / $( basename " $f " ) "
49
49
fi
50
50
else
51
- source_file_name=" $file_name "
51
+ source_file_name=$( basename " $f " )
52
52
fi
53
53
54
54
if [[ -n " $source_file_name " ]]; then
@@ -82,19 +82,3 @@ for template_dir in templates/*; do
82
82
find " $template_dir " -type l -ls
83
83
echo
84
84
done
85
-
86
- # Generate Mermaid graph showing links
87
- mermaid_file_name=" $script_dir /links.mermaid"
88
-
89
- cat > | " $mermaid_file_name " << 'EOF '
90
- graph TD
91
- EOF
92
- for link in $( find templates -type l) ; do
93
- link_id=$( base64 <<< $link )
94
- link_id=${link_id// =}
95
-
96
- target=$( readlink $link )
97
- target_id=$( base64 <<< $target )
98
- target_id=${target_id// =}
99
- echo " $link_id [$link ] --> $target_id [$target ]" >> " $mermaid_file_name "
100
- done
0 commit comments