forked from sakithb/media-controls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·61 lines (47 loc) · 1.37 KB
/
build.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
#! /bin/bash
# Use the -p flag to generate the zip file, the -r flag to restart the gnome shell and -i flag to install extension
EXT_DIR="$HOME/.local/share/gnome-shell/extensions/[email protected]/";
install() {
curl -OL https://github.com/cliffniff/media-controls/releases/latest/download/extension.zip;
gnome-extensions install -f extension.zip
rm -rf extension.zip
}
build() {
git archive -o Release.zip HEAD;
zip -d Release.zip README.md;
zip -d Release.zip images/*;
zip -d Release.zip images/;
zip -d Release.zip .gitignore;
zip -d Release.zip build.sh;
zip -d Release.zip install.sh;
zip -d Release.zip .github/*;
zip -d Release.zip .github/;
VERSION=$(cat metadata.json | grep '\"version\"' | sed 's/[^0-9]*//g');
if [[ `git status --porcelain` ]]; then
VERSION="~$VERSION~" ;
fi
mkdir -p "./builds/v$VERSION";
mv Release.zip "./builds/v$VERSION/extension.zip";
}
restart() {
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")';
}
copy() {
mkdir -p "$EXT_DIR";
cp -r ./* "$EXT_DIR";
}
PARAMS=();
for i in $@
do
PARAMS+=( $i )
done
if [[ " ${PARAMS[*]} " =~ " -p " ]]; then
build;
fi
if [[ " ${PARAMS[*]} " =~ " -i " ]]; then
install;
fi
if [[ " ${PARAMS[*]} " =~ " -r " ]]; then
copy;
restart;
fi