github.com/artpar/rclone@v1.67.3/bin/make_rc_docs.sh (about)

     1  #!/bin/bash
     2  # Insert the rc docs into docs/content/rc.md
     3  
     4  set -e
     5  
     6  go install
     7  mkdir -p /tmp/rclone/cache_test
     8  mkdir -p /tmp/rclone/rc_mount
     9  export RCLONE_CONFIG_RCDOCS_TYPE=cache
    10  export RCLONE_CONFIG_RCDOCS_REMOTE=/tmp/rclone/cache_test
    11  rclone -q --rc mount rcdocs: /tmp/rclone/rc_mount &
    12  sleep 0.5
    13  rclone rc > /tmp/rclone/z.md
    14  fusermount -u -z /tmp/rclone/rc_mount > /dev/null 2>&1 || umount /tmp/rclone/rc_mount
    15  
    16  awk '
    17      BEGIN       {p=1}
    18      /^\{\{< rem autogenerated start/  {print;system("cat /tmp/rclone/z.md");p=0}
    19      /^\{\{< rem autogenerated stop/   {p=1}
    20      p' docs/content/rc.md > /tmp/rclone/rc.md
    21  
    22  mv /tmp/rclone/rc.md docs/content/rc.md
    23  rm -rf /tmp/rclone