-
Notifications
You must be signed in to change notification settings - Fork 7
/
make.sh
45 lines (37 loc) · 912 Bytes
/
make.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
#!/bin/sh
type=$(ps -p $$ -o comm=)
yellow='\033[93m'
green='\033[92m'
red='\033[91m'
endc='\033[0m'
print() {
if [ "$type" = "bash" ]; then
echo -e "$1"
else
echo "$1"
fi
}
doing() {
print "$yellow[*] $1...$endc"
}
finished() {
lowercase=$(print "$1" | tr '[:upper:]' '[:lower:]')
print "$green[+] Done $lowercase!$endc"
}
failed() {
lowercase=$(print "$1" | tr '[:upper:]' '[:lower:]')
print "$red[-] Failed $lowercase!$endc"
exit 1
}
task() {
doing "$1"
if sh -c "$2"; then
finished "$1"
else
failed "$1"
fi
}
task "Clearing packages directory" "rm -rf packages/*;"
# task "Cleaning paths" "gmake clean;"
task "Making tweak" "gmake package && [ -e \$(find packages/com.rosiepie.flora*.deb) ];"
task "Renaming package filename" "find packages/com.rosiepie.flora*.deb -exec sh -c 'mv \"\$0\" packages/Flora.deb' {} \;"