Check-in [5f780148f7]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | fox errlevel handling |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
5f780148f76d54efe1d8ff707a350a48 |
| User & Date: | mario 2021-10-12 10:01:57 |
Context
|
2021-10-12
| ||
| 10:02 | change tblname whitelist check-in: ade7daec5b user: mario tags: trunk | |
| 10:01 | fox errlevel handling check-in: 5f780148f7 user: mario tags: trunk | |
| 10:01 | add config props check-in: 006b1be81a user: mario tags: trunk | |
Changes
Changes to tools/fossilwikiedit.
| ︙ | ︙ | |||
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 |
EXISTS=0
# pagename
if [ -z "$PAGE" ]
then
echo Syntax: $0 PageName
exit
fi
# test
EXISTS=$(fossil wiki ls | egrep "^$PAGE$")
if [ ! $EXISTS ]
then
PAGE=$(fossil wiki ls|egrep -m1 -i "^$PAGE$" || fossil wiki ls|grep -m1 -i "$PAGE")
if [ -n "$PAGE" ]
then
echo "Found similar page name: '$PAGE'"
EXISTS=1
else
PAGE=$1
echo "New page: '$PAGE'"
ADDFN=".new"
fi
fi
# export
| > > > > | > | | > | 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 |
EXISTS=0
# pagename
if [ -z "$PAGE" ]
then
echo Syntax: $0 PageName
exit
elif [ "$PAGE" = "ls" ]
then
fossil wiki ls
exit
fi
# test
EXISTS=$(fossil wiki ls | egrep "^$PAGE$")
if [ ! $EXISTS ]
then
PAGE=$(fossil wiki ls|egrep -m1 -i "^$PAGE$" || fossil wiki ls|grep -m1 -i "$PAGE")
if [ -n "$PAGE" ]
then
echo "Found similar page name: '$PAGE'"
EXISTS=1
else
PAGE=$1
echo "New page: '$PAGE'"
ADDFN=".new"
fi
fi
# export
FILE="/tmp/fossilwikiedit$ADDFN.$PAGE"
fossil sync
fossil wiki export "$PAGE" "$FILE"
# edit
MD5=$(md5sum "$FILE")
$EDITOR "$FILE"
MD5NEW=$(md5sum "$FILE")
# save?
if [ "$MD5NEW" != "$MD5" ]
then
if [ $EXISTS ]
then
fossil wiki commit "$PAGE" "$FILE"
else
fossil wiki create "$PAGE" "$FILE" --mimetype text/x-markdown
fi
if [ $? ]
then
fossil sync
rm "$FILE"
fi
else
rm "$FILE"
fi
|