-
Notifications
You must be signed in to change notification settings - Fork 1
/
workspace.sh
43 lines (34 loc) · 833 Bytes
/
workspace.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
# particles shell workspace file
export workspace="particles"
## Generate the zip file
particles.zip() {
if [[ ! -z "$(git status -z)" ]]; then
echo "Uncommitted changes. Don't zip like this"
return 1
fi
local tmp="./particles.widget"
local zip_contents=(
./src
widget.json
particles.jsx
LICENSE
README.md
)
rm particles.widget.zip
mkdir "$tmp"
for item in "${zip_contents[@]}"; do
cp -r $item "${tmp}"
done
git show --no-patch > "${tmp}/commit.txt"
zip -r particles.widget.zip ./particles.widget
rm -rf "$tmp"
}
particles.link() {
local widgets="${HOME}/Library/Application Support/Übersicht/widgets"
if [[ ! -f './particles.coffee' ]]; then
echo "Run this from the project root folder"
return 1
fi
echo "./ -> $widgets"
ln -s "$PWD" "$widgets"
}