website/scripts: Add docsmg migration tool (#10658)

* add docsmg tool

* moved to the correct scripts directory

* removed test files
This commit is contained in:
Bama
2024-07-26 15:54:41 -05:00
committed by GitHub
parent 45e464368e
commit 59973d1f06
10 changed files with 878 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
_completions () {
if [[ -z "${MIGRATE_PATH}" ]];
then MIGRATE_PATH="./";
else MIGRATE_PATH="${MIGRATE_PATH}"; fi
if [[ -z "${TMP_STRUCTURE_PATH}" ]];
then TMP_STRUCTURE_PATH="./tmp/";
else TMP_STRUCTURE_PATH="${TMP_STRUCTURE_PATH}"; fi
if [[ $1 = $3 ]];
then LSPATH="$MIGRATE_PATH";
else LSPATH="$TMP_STRUCTURE_PATH"; fi
for i in $(compgen -f -- "$LSPATH$2" | cut -d "/" -f 2-); do
if [[ -d "$LSPATH$i" ]];
then COMPREPLY+=("$i/");
else COMPREPLY+=("$i"); fi
done
}
complete -o nospace -o filenames -F _completions m.bash