Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / g1a / composer-test-scenarios / scripts / dependency-licenses
1 #!/bin/bash
2
3 #
4 # Append the licenses for this project's dependencies to the end of the LICENSE file, if it exists.
5 #
6
7 dir='.'
8 target='./LICENSE'
9 tmp="$target.tmp"
10 year="$(date '+%Y')"
11
12 # Update dependency licenses in the LICENSE file, if it exists.
13 if [[ -f "$target" ]] ; then
14   sed \
15     -e "s/\(^ *Copyright [^0-9]*[0-9][0-9][0-9][0-9]\)\([0-9-]*\)/\1-$year/" \
16     -e "s/\(^ *Copyright [^0-9]*$year\)\(-$year\)/\1/" \
17     -e '/DEPENDENCY LICENSES:/,$d' "$target" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' > "$tmp"
18   (
19     echo
20     echo "DEPENDENCY LICENSES:"
21     echo
22     composer -n --working-dir=$dir licenses --no-dev | sed -e '1,/^ *$/d'
23   ) >> "$tmp"
24   mv -f "$tmp" "$target"
25 fi