-
Notifications
You must be signed in to change notification settings - Fork 44
/
create_t3mujinpack_release.sh
executable file
·86 lines (59 loc) · 2.03 KB
/
create_t3mujinpack_release.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
#!/bin/bash
# Creates t3mujinpack releases in different flavors.
#
# Author: João Almeida <[email protected]>
set -euo pipefail
die () {
echo ""
echo ""
echo -ne "${YELLOW}$@${NC}"
echo ""
exit 1
}
# Initialize output colors
LIGHT_GREY='\033[0;37m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
LIGHT_BLUE='\033[1;34m'
NC='\033[0m' # No Color
echo ""
echo "----------------------------------------------------------------------"
echo -e "${LIGHT_BLUE}t3mujinpack - Film emulation presets for Darktable"
echo ""
echo -e "Create Releases script${NC}"
echo "----------------------------------------------------------------------"
[ "$#" -eq 1 ] || die "Missing version number"
echo ""
echo "Generating releases for version $1"
# Generate temporary bundle folder with bundled files and move base files
if [ ! -d "t3mujinpack" ]; then
mkdir t3mujinpack
fi
cp -r bin t3mujinpack
cp remove_t3mujinpack.* t3mujinpack
cp README.md t3mujinpack
cp LICENSE.txt t3mujinpack
# Create 1 level hierarchy
echo -e "${LIGHT_BLUE}Creating release with one level${NC}"
cp t3mujinpack*.dtstyle t3mujinpack
sed -i -e "s/\[master\]/$1/g" t3mujinpack/*.dtstyle
zip -r "./t3mujinpack_$1_one-level.zip" t3mujinpack/*
# Create 2 level hierarchy
cp t3mujinpack*.dtstyle t3mujinpack
sed -i -e "s/\[master\]/$1/g" t3mujinpack/*.dtstyle
sed -i -e "s/t3mujinpack - /t3mujinpack|/g" t3mujinpack/*.dtstyle
zip -r "./t3mujinpack_$1_two-level.zip" t3mujinpack/*
# Create flat hierarchy
cp t3mujinpack*.dtstyle t3mujinpack
sed -i -e "s/\[master\]/$1/g" t3mujinpack/*.dtstyle
sed -i -e "s/t3mujinpack - Black and White|/t3mujinpack - Black and White - /g" t3mujinpack/*.dtstyle
sed -i -e "s/t3mujinpack - Color Negative|/t3mujinpack - Color Negative - /g" t3mujinpack/*.dtstyle
sed -i -e "s/t3mujinpack - Color Slide|/t3mujinpack - Color Slide - /g" t3mujinpack/*.dtstyle
zip -r "./t3mujinpack_$1_flat.zip" t3mujinpack/*
# clear temporary files
rm -rf t3mujinpack
echo ""
echo ""
echo -ne "${GREEN}t3mujinpack release files have been created!${NC}"
echo ""
echo ""