2018-04-23 21:44:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Insert the rc docs into docs/content/rc.md
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
go install
|
2018-10-24 08:09:20 +02:00
|
|
|
mkdir -p /tmp/rclone/cache_test
|
|
|
|
mkdir -p /tmp/rclone/rc_mount
|
2018-04-23 21:44:44 +02:00
|
|
|
export RCLONE_CONFIG_RCDOCS_TYPE=cache
|
|
|
|
export RCLONE_CONFIG_RCDOCS_REMOTE=/tmp/rclone/cache_test
|
2018-10-24 08:09:20 +02:00
|
|
|
rclone -q --rc mount rcdocs: /tmp/rclone/rc_mount &
|
2018-04-23 21:44:44 +02:00
|
|
|
sleep 0.5
|
2018-10-24 08:09:20 +02:00
|
|
|
rclone rc > /tmp/rclone/z.md
|
|
|
|
fusermount -u -z /tmp/rclone/rc_mount > /dev/null 2>&1 || umount /tmp/rclone/rc_mount
|
2018-04-23 21:44:44 +02:00
|
|
|
|
|
|
|
awk '
|
|
|
|
BEGIN {p=1}
|
2018-10-24 08:09:20 +02:00
|
|
|
/^<!--- autogenerated start/ {print;system("cat /tmp/rclone/z.md");p=0}
|
2018-04-23 21:44:44 +02:00
|
|
|
/^<!--- autogenerated stop/ {p=1}
|
2018-10-24 08:09:20 +02:00
|
|
|
p' docs/content/rc.md > /tmp/rclone/rc.md
|
2018-04-23 21:44:44 +02:00
|
|
|
|
2018-10-24 08:09:20 +02:00
|
|
|
mv /tmp/rclone/rc.md docs/content/rc.md
|
|
|
|
rm -rf /tmp/rclone
|