-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.sh
executable file
·89 lines (41 loc) · 1.52 KB
/
script.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
wawa=$1;
pluginDir=$1;
mainDir=$2;
composerPhar=$3;
drupalRoot=$4;
cd $pluginDir;
cwd=$(pwd);
if [[ "$pluginDir" = "$cwd" ]]; then
rm -rf d8LatestTemplate;
$composerPhar create-project drupal-composer/drupal-project:8.x-dev d8LatestTemplate --stability dev --no-interaction;
cd d8LatestTemplate;
tempDir="d8LatestTemplate";
tempPath="$pluginDir/$tempDir";
cwd2=$(pwd);
if [[ "$tempPath" = "$cwd2" ]]; then
cp $tempPath/composer.json $pluginDir/template.composer.json;
cp -a $tempPath/drush/. $mainDir/drush/;
cp -a $tempPath/scripts/. $mainDir/scripts/;
cp -a $tempPath/web/. $mainDir/web;
cp $tempPath/.travis.yml $mainDir/.travis.yml;
cp $tempPath/load.environment.php $mainDir/load.environment.php;
if [[ "$drupalRoot" != "$mainDir/web" ]]; then
rm -rf $mainDir/web/modules;
rm -rf $mainDir/web/themes;
rm -rf $mainDir/web/profiles;
rm -rf $mainDir/web/libraries;
rm -rf $mainDir/web/core;
cp -a $drupalRoot/Libraries/. $mainDir/web/Libraries/;
cp -a $drupalRoot/profiles/. $mainDir/web/profiles/;
mkdir $mainDir/web/modules;
cp -a $drupalRoot/modules/custom/. $mainDir/web/modules/custom/;
cp -a $drupalRoot/themes/. $mainDir/web/themes/;
else
#cp $tempPath/web/. $drupalRoot;
rsync -r $tempPath/web/. $drupalRoot/. --exclude='*/'
fi
rm $mainDir/composer.lock;
rm -rf $tempPath;
fi
fi