-
Notifications
You must be signed in to change notification settings - Fork 12
/
.any-format
executable file
·13 lines (13 loc) · 1017 Bytes
/
.any-format
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
#
# Reorder property attributes in one possible way
#
# @property (nullable, readonly, assign, nonatomic, getter=isReady) BOOL ready;
#
# 1. Move readonly to the BEGIN of attribute list
# 2. Move nullable to the BEGIN of attribute list
# 3. Move null_resettable to the BEGIN of attribute list
# 4. Move nonatomic to the END of attribute list
# 5. Move getter to the END of attribute list
#
/usr/bin/sed -i '' 's#(\([^)]*\),[ ]*readonly)#(readonly, \1)#g; s#(\([^)]*\),[ ]*readonly,[ ]*\([^)]*\))#(readonly, \1, \2)#g; s#(\([^)]*\),[ ]*nullable)#(nullable, \1)#g; s#(\([^)]*\),[ ]*nullable,[ ]*\([^)]*\))#(nullable, \1, \2)#g; s#(\([^)]*\),[ ]*null_resettable)#(null_resettable, \1)#g; s#(\([^)]*\),[ ]*null_resettable,[ ]*\([^)]*\))#(null_resettable, \1, \2)#g; s#(nonatomic,[ ]*\([^)]*\))#(\1, nonatomic)#g; s#(\([^)]*\),[ ]*nonatomic,[ ]*\([^)]*\))#(\1, \2, nonatomic)#g; s#(getter=\([^), ]*\),[ ]*\([^)]*\))#(\2, getter=\1)#g; s#(\([^)]*\),[ ]*getter=\([^), ]*\),[ ]*\([^)]*\))#(\1, \3, getter=\2)#g' $*