forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
move_docs.sh
39 lines (30 loc) · 901 Bytes
/
move_docs.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Copyright (c) Aptos
# SPDX-License-Identifier: Apache-2.0
# This builds the move docs for the Aptos-framework
# Removes the awkward links so that it can be reasonably well self-hosted
# And moves them to a local folder
current_path=$PWD
root_path="$(dirname $0)/.."
move_path="$root_path/aptos-move/framework"
cd $move_path
cargo run
if [[ "$1" ]]; then
outpath="$1"
else
outpath="output"
fi
cd $current_path
rm -rf $outpath
mkdir -p $outpath
RELEASE_PATH="$move_path/aptos-framework/releases/artifacts/current/build"
for folder in $(ls $RELEASE_PATH); do
mkdir -p $outpath/$folder
for file in $(ls $RELEASE_PATH/$folder/docs); do
outfile=$outpath/$folder/$file
cp $RELEASE_PATH/$folder/docs/$file $outfile
sed -i \
's#../../../../../../../aptos-framework/releases/artifacts/current/build/\(.*\)/docs/\(.*.md\)#../\1/\2#g' \
$outfile
done
done