Skip to content

Commit e922dde

Browse files
committed
Add in-workflow updates
1 parent e4b7133 commit e922dde

40 files changed

+415
-210
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Keep the generated binary out of the repo
22
/alfssh
3+
/build
34
# And the file for generating data
45
/demo-data.py
56

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ If you need Alfred 2 support, check out [@isometry's workflow][ssh-breathe].
102102
Changelog
103103
---------
104104

105+
- v.0.6.0 — 2016-11-09
106+
- Add in-workflow updates
105107
- v.0.5.0 — 2016-10-31
106108
- Add support for SSH configuration files (`~/.ssh/config` and `/etc/ssh/ssh_config`)
107109
- Alternate action: open connection with `mosh`

Secure-SHell-0.5.alfredworkflow

-1.22 MB
Binary file not shown.

Secure-SHell-0.6.alfredworkflow

2.28 MB
Binary file not shown.

build-workflow.sh

Lines changed: 0 additions & 88 deletions
This file was deleted.

build-workflow.zsh

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#!/usr/bin/env zsh
2+
3+
wffiles=(alfssh icon.png update.png info.plist README.md LICENCE.txt)
4+
# Icons
5+
icons=(icons/icon.iconset icons/update.iconset)
6+
7+
here="$( cd "$( dirname "$0" )"; pwd )"
8+
delbuild=1
9+
10+
log() {
11+
echo "$@" > /dev/stderr
12+
}
13+
14+
do_dist=0
15+
do_clean=0
16+
17+
usage() {
18+
cat <<EOS
19+
build-workflow.zsh [options]
20+
21+
Build the .alfredworkflow file
22+
23+
Usage:
24+
build-workflow.zsh [-d] [-c]
25+
build-workflow.zsh -h
26+
27+
Options:
28+
-c Clean the build directory
29+
-d Also build distributable .alfredworkflow file
30+
-h Show this help message and exit
31+
EOS
32+
}
33+
34+
while getopts ":cdh" opt; do
35+
case $opt in
36+
c)
37+
do_clean=1
38+
;;
39+
d)
40+
do_dist=1
41+
;;
42+
h)
43+
usage
44+
exit 0
45+
;;
46+
\?)
47+
log "Invalid option: -$OPTARG"
48+
exit 1
49+
;;
50+
esac
51+
done
52+
shift $((OPTIND-1))
53+
54+
cleanup() {
55+
local p="${here}/build"
56+
log "Cleaning up ..."
57+
test -d "$p" && rm -rf ./build/
58+
}
59+
60+
pushd "$here" &> /dev/null
61+
62+
log "Building executable(s) ..."
63+
go build -v -o ./alfssh ./cmd/alfssh
64+
ST_BUILD=$?
65+
if [ "$ST_BUILD" != 0 ]; then
66+
log "Error building executable."
67+
cleanup
68+
popd &> /dev/null
69+
exit $ST_BUILD
70+
fi
71+
72+
chmod 755 ./alfssh
73+
# cp -v ./alfssh ./build/alfssh
74+
75+
log
76+
77+
log "Cleaning ./build ..."
78+
rm -rvf ./build
79+
80+
log
81+
82+
log "Copying assets to ./build ..."
83+
84+
for f in $icons; do
85+
n="${f:t:r}"
86+
cp -v "${f}/icon_128x128.png" "./${n}.png"
87+
done
88+
89+
mkdir -vp ./build
90+
91+
for n in $wffiles; do
92+
cp -v "$n" ./build/
93+
done
94+
95+
96+
log
97+
98+
if [[ $do_dist -eq 1 ]]; then
99+
# Get the dist filename from the executable
100+
zipfile="$(./alfssh print distname 2> /dev/null)"
101+
if [ "$?" -ne 0 ]; then
102+
log "Error getting distname from alfssh."
103+
cleanup
104+
exit 1
105+
fi
106+
107+
log
108+
109+
if test -e "$zipfile"; then
110+
log "Removing existing .alfredworkflow file ..."
111+
rm -rvf "$zipfile"
112+
log
113+
fi
114+
115+
pushd ./build/ &> /dev/null
116+
117+
log "Cleaning info.plist ..."
118+
/usr/libexec/PlistBuddy -c 'Delete :variables:DEMO_MODE' info.plist
119+
120+
log "Building .alfredworkflow file ..."
121+
zip "../${zipfile}" ./*
122+
ST_ZIP=$?
123+
if [ "$ST_ZIP" != 0 ]; then
124+
log "Error creating .alfredworkflow file."
125+
popd &> /dev/null
126+
cleanup
127+
popd &> /dev/null
128+
exit $ST_ZIP
129+
fi
130+
popd &> /dev/null
131+
132+
log
133+
log "Wrote '${zipfile}' in '$( pwd )'"
134+
fi
135+
136+
[[ $do_clean -eq 1 ]] && cleanup
137+
138+
139+
popd &> /dev/null

0 commit comments

Comments
 (0)