-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.sh
executable file
·63 lines (56 loc) · 1.73 KB
/
debug.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
# Copyright (c) 2007 David Kocher. All rights reserved.
# http://cyberduck.ch/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Bug fixes, suggestions and comments should be sent to:
# dkocher@cyberduck.ch
#!/bin/sh
workdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
usage() {
echo ""
echo " Usage: debug.sh [--enable | -e] [--disable | -d]"
echo ""
}
enable() {
# When enabled, you can connect to the running application using
# -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
basedir="$( cd "$workdir" && pwd )"
echo $basedir
cp $basedir/setup/app/Info.plist.debug $basedir/osx/target/Cyberduck.app/Contents/Info.plist;
}
disable() {
basedir="$( cd "$workdir" && pwd )"
echo $basedir
cp $basedir/setup/app/Info.plist $basedir/osx/target/Cyberduck.app/Contents/Info.plist;
}
while [ "$1" != "" ] # When there are arguments...
do case "$1" in
-e | --enable)
echo "Enabling debug configuration...";
enable;
exit 0;
echo "*** DONE. ***";
;;
-d | --disable)
echo "Disabling debug configuration...";
disable;
echo "*** DONE. ***";
exit 0;
;;
*)
echo "Option [$1] not one of [--enable, --disable]"; # Error (!)
usage;
exit 1
;; # Abort Script Now
esac;
done;
usage;