-
Notifications
You must be signed in to change notification settings - Fork 0
/
updater.sh
executable file
·67 lines (45 loc) · 1.9 KB
/
updater.sh
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
#!/bin/bash
### Options ###
while getopts d:g option
do
case "${option}"
in
d) PROJECTPATH=${OPTARG};;
g) GNUCOMP=true;;
esac
done
### Project path? ###
if [ -z "$PROJECTPATH" ]; then
echo -n "Enter the full path to your project's root directory: "
read -e PROJECTPATH
fi
cd $PROJECTPATH
### Use GNU sed ###
if [ "$GNUCOMP" = true ]; then
SED=gsed
else
SED=sed
fi
### Update repository info ###
echo "Replacing outdated repository information."
$SED -i 's/_curie\.git/.git/g' composer.json
$SED -i 's/-8\.x\.git/.git/g' composer.json
### Update module constraints ###
echo "Updating module constraints for D9 compatibility."
rm composer.lock
$SED -i 's/"gt\/gt_profile_curie": ".*"/"gt\/gt_profile": "^3.0"/g' composer.json
$SED -i 's/"gt\/gt_theme": ".*"/"gt\/gt_theme": "^3.0"/g' composer.json
$SED -i 's/"gt\/gt_tools": ".*"/"gt\/gt_tools": "^3.0"/g' composer.json
$SED -i 's/"drush\/drush": ".*"/"drush\/drush": "^10.0"/g' composer.json
$SED -i 's/"drupal\/devel": ".*"/"drupal\/devel": "^4.0"/g' composer.json
$SED -i 's/"drupal\/views_taxonomy_term_name_depth": ".*"/"drupal\/views_taxonomy_term_name_depth": "^7.0"/g' composer.json
$SED -i 's/"drupal\/faqfield": ".*"/"drupal\/faqfield": "^7.0"/g' composer.json
$SED -i 's/"drupal\/views_accordion": ".*"/"drupal\/views_accordion": "^2.0"/g' composer.json
$SED -i 's/"drupal\/webform": ".*"/"drupal\/webform": "^6.0"/g' composer.json
$SED -i 's/"drupal\/core": ".*",*//g' composer.json
$SED -i 's/"drupal\/core-dev": ".*",*//g' composer.json
$SED -i 's/"webflo\/drupal-core-require-dev": ".*",*//g' composer.json
### Install D9 ###
composer require 'drupal/core-recommended:^9' 'drupal/core-composer-scaffold:^9' 'drupal/core-project-message:^9' --update-with-dependencies --no-update
composer update -W
echo "Finished. If you do not see any errors (ignore warnings of abandoned packages) go to yoursite.gatech.edu/update.php to update your site's database."