forked from formers/former
-
Notifications
You must be signed in to change notification settings - Fork 0
/
master
49 lines (38 loc) · 900 Bytes
/
master
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
#!/bin/bash
# Updates the master branch
composer install
required=("src" "vendor")
dependencies=("autoload.php" "composer" "illuminate/config" "illuminate/filesystem" "illuminate/translation" "mockery" "symfony")
# Create a temporary directory
rm -rf tmp
mkdir tmp
# Copy the important files in it
for file in "${required[@]}"
do
echo "Copying $file"
cp -R $file tmp/$file
done
cp ./* tmp/
# Remove unecessary dependencies
for dependency in "${dependencies[@]}"
do
echo "Deleting vendor/$dependency"
rm -rf tmp/vendor/$dependency
done
# Remove .git folders
for folder in tmp/vendor/*
do
rm -rf $folder/{*,*/*,*/*/*}/.git
done
# Switch branch
git checkout master
# Delete current tree
rm -rf ./{tests,vendor,src}
rm -rf ./*.{xml,md,php,lock,json,yml}
rm -rf .gitignore
# Copy new one
cp -R tmp/* ./
rm -rf tmp/
git add .
git commit -m "Update master branch"
git push origin master