-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
readmemod
executable file
·25 lines (22 loc) · 834 Bytes
/
readmemod
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
#!/bin/bash
# Toggles read-only status of the README.md files found in a project. When enabled, the README.md files will be
# rendered as HTML. When unlocked, they are shown as raw markdown text and they can be edited.
FORCE=""
case "${1}" in
unlock) FORCE="U";;
lock) FORCE="L";;
*) FORCE="";
esac
for DIR in *.xcodeproj; do
if [[ -f "${DIR}/.xcodesamplecode.plist" ]]; then
if [[ "${FORCE:-U}" = "U" ]]; then
mv "${DIR}/.xcodesamplecode.plist" "${DIR}/dot_xcodesamplecode.plist"
echo "-- unlocking ${DIR} markdowns"
fi
elif [[ -f "${DIR}/dot_xcodesamplecode.plist" ]]; then
if [[ "${FORCE:-L}" = "L" ]]; then
mv "${DIR}/dot_xcodesamplecode.plist" "${DIR}/.xcodesamplecode.plist"
echo "-- locking ${DIR} markdowns"
fi
fi
done