-
Notifications
You must be signed in to change notification settings - Fork 9
/
watchpaths
180 lines (116 loc) · 4.49 KB
/
watchpaths
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/usr/bin/env zsh
#DIRTY="$(dirname $0)/dirty"
#/bin/cat /dev/null >! "$DIRTY"
#FLAGS='' #'-0 --event-flags --follow-links'
INC=(
'/a2Z/*'
'/sd/dev/IO/*'
)
EXC=(
'xcuserdata'
'.git'
)
IGNORE=(
lock
xcuserdata
)
#--event-flags
CMD=( /usr/local/bin/fswatch --follow-links --event-flags)
CMD+="${INC[@]/#/ -i }"
CMD+="${IGNORE[@]/#/ -e }"
#a line: /sd/AtoZ.framework/com.mrgray.at
#CMD="$FLAGS -i $(echo ${(j: -i :)INC}) -e $(echo ${(j: -e :)EXC})"
echo "cmd is $CMD"
while read line; do
[[ "$line" =~ "IO" ]] && PROJ=IO || \
[[ "$line" =~ "AtoZ" ]] && PROJ=AtoZ
echo "ptoj: $PROJ for $line"
done < <( eval "$CMD" )
#fswatch $CMD | xargs -I{} echo "saving " {}
export UNIVERSAL_ARCHS="arm64" "armv7" "i386" "x86_64"
installTouchFramework() {
declare -a LINKERS
local TARGET="AtoZTouch"
local SRCROOT="/a2z/AtoZ"
local TARGET_BUILD_DIR="/dd/AtoZ"
local BUILD_CMD="/usr/bin/xcodebuild -configuration Debug IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-project $SRCROOT/AtoZ.xcodeproj \
-scheme $TARGET"
cd $TARGET_BUILD_DIR
for arch in $UNIVERSAL_ARCHS; do
[[ "$arch" =~ ("arm64"|"arm") ]] && PLATFORM=iphoneos || PLATFORM=iphonesimulator
BUILD_IN="$TARGET_BUILD_DIR/build-$arch"
eval "$BUILD_CMD -sdk \"$PLATFORM\" \
ARCHS=\"$arch\" \
VALID_ARCHS=\"$arch\" \
TARGET_BUILD_DIR=\"$BUILD_IN\" \
BUILT_PRODUCTS_DIR=\"$BUILD_IN\" | xcpretty"
LINKERS+=("$TARGET_BUILD_DIR/build-$arch/AtoZTouch.framework/AtoZTouch")
done
DEST="$TARGET_BUILD_DIR/AtoZTouch.framework"
rm -rf "$DEST"
cp -r "$TARGET_BUILD_DIR/build-arm64/AtoZTouch.framework" "$TARGET_BUILD_DIR"
rm -rf "$DEST/AtoZTouch"
lipo -create $LINKERS -output "$DEST/AtoZTouch"
otool -L $DEST/AtoZTouch
[[ "$?" -ne "0" ]] && return 9
/usr/bin/scp -P22100 -r "$DEST" [email protected]:/Library/Frameworks
say A to Z Touch Installed on device.
}
# installTouchFramework
# -iL /dd/AtoZ/**/(AtoZTouch|SS)
# /usr/local/bin/fswatch -iL /dd/AtoZ/** | xargs -I{} say rebuilding {}
# $process "$(echo {} | sed 's:/sd/::g')"
# while read -d "" event; do \
# echo "saving ${event}" \
# echo ${event} >! "$DIRTY" \
# done
# /usr/local/bin/fswatch \
# \
# --event-flags --follow-links \
# --event-flag-separator "?" \
# -i /a2Z/** \
# -i /sd/dev/IO/** \
# -e xcuserdata \
# -e .git \
# | xargs -I{} $process "$(echo {} | sed 's:/sd/::g')"
# /xbin/universalframework {} && say rebuilding
# eval "$(xcodebuild -showBuildSettings | sed '1d;s/^ *//;s/"/\\"/g;s/ = \(.*\)/="\1"/;s/ = /=/;s/UID.*//'| grep '=')"
# CODE_SIGNING_REQUIRED='NO' \
# CODESIGNING_IDENTITY=''"
# lipo -create ; do echo '#{build_dir}/build-$arch/#{target}#{wrapper}/#{target}'
# env
export process='say'
: ' fswatch [OPTION] ... path ...
Options:
-0, --print0 Use the ASCII NUL character (0) as line separator.
-1, --one-event Exit fswatch after the first set of events is received.
--batch-marker Print a marker at the end of every batch.
-e, --exclude=REGEX Exclude paths matching REGEX.
-E, --extended Use extended regular expressions.
--format=FORMAT Use the specified record format.
-f, --format-time Print the event time using the specified format.
-h, --help Show this message.
-i, --include=REGEX Include paths matching REGEX.
-I, --insensitive Use case insensitive regular expressions.
-l, --latency=DOUBLE Set the latency.
-L, --follow-links Follow symbolic links.
-m, --monitor=NAME Use the specified monitor.
-n, --numeric Print a numeric event mask.
-o, --one-per-batch Print a single message with the number of change events.
-r, --recursive Recurse subdirectories.
-t, --timestamp Print the event timestamp.
-u, --utc-time Print the event time as UTC time.
-v, --verbose Print verbose output.
--version Print the version of fswatch and exit.
-x, --event-flags Print the event flags.
--event-flag-separator=STRING
Print event flags using the specified separator.
Available monitors in this platform:
fsevents_monitor
kqueue_monitor
poll_monitor
See the man page for more information.
Report bugs to <[email protected]>.
fswatch home page: <https://github.com/emcrisostomo/fswatch>.
'