forked from packlink-dev/gitignore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.post-merge.sh
executable file
·37 lines (25 loc) · 1.2 KB
/
.post-merge.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
#!/bin/sh
# Concat all files ending with .gitignore into a single temporary file
find . -type f -name "*.gitignore" -exec sh -c 'cat {} >> ".gitignore_packlink.new"' \;
# Remove entry that ignores untracked files
sed -i -e '/^\/\*$/d' ./.gitignore_packlink.new
# Remove entry that ignores untracked files under src folder
sed -i -e '/^src\/$/d' ./.gitignore_packlink.new
# Remove entry that ignores untracked sql files
sed -i -e '/^\*\.sql$/d' ./.gitignore_packlink.new
# Remove entry that ignores untracked certificates
sed -i -e '/^\*\.crt$/d' ./.gitignore_packlink.new
# Remove entry that ignores the \config folder
sed -i -e '/^\/config\/\*$/d' ./.gitignore_packlink.new
# Remove entry that ignores xml files
sed -i -e '/^\*\.xml$/d' ./.gitignore_packlink.new
# Remove entry that ignores the test/ folder
sed -i -e '/^test\/$/d' ./.gitignore_packlink.new
# Remove entry that ignores the _snapshots_/ folder
sed -i -e '/^_snapshots_\/$/d' ./.gitignore_packlink.new
# Remove entry that ignores snap files
sed -i -e '/^\*\.snap$/d' ./.gitignore_packlink.new
# Move the temporary file into the final location
mv ./.gitignore_packlink.new $HOME/.gitignore_packlink
# Remove temporary file
rm -f ./gitignore_packlink.new