mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 13:15:34 +00:00
Find luarocks package installations in a more robust way
This commit is contained in:
parent
67f0d37c20
commit
c064e9ebf9
3 changed files with 12 additions and 20 deletions
|
@ -6,9 +6,6 @@ echo "Install Teal Cyan"
|
||||||
git clone https://github.com/teal-language/cyan.git --depth 1
|
git clone https://github.com/teal-language/cyan.git --depth 1
|
||||||
cd cyan
|
cd cyan
|
||||||
luarocks make cyan-dev-1.rockspec
|
luarocks make cyan-dev-1.rockspec
|
||||||
|
|
||||||
LUAROCKS=~/luarocks/bin
|
|
||||||
export LUAROCKS
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
scripts/generate_teal_declarations.sh ./teal_declarations
|
scripts/generate_teal_declarations.sh ./teal_declarations
|
||||||
|
|
|
@ -3,17 +3,16 @@
|
||||||
DOCS_SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
DOCS_SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
FILES_DIR=$DOCS_SOURCE_DIR/../../files
|
FILES_DIR=$DOCS_SOURCE_DIR/../../files
|
||||||
OUTPUT_DIR=$DOCS_SOURCE_DIR/reference/lua-scripting/generated_html
|
OUTPUT_DIR=$DOCS_SOURCE_DIR/reference/lua-scripting/generated_html
|
||||||
DOCUMENTOR_PATH=~/.luarocks/bin/openmwluadocumentor
|
|
||||||
|
|
||||||
if [ ! -x $DOCUMENTOR_PATH ]; then
|
PATH=$PATH:~/lua-5.1.5/src
|
||||||
|
eval "$(luarocks path)"
|
||||||
|
|
||||||
|
if [ ! command -v openmwluadocumentor &> /dev/null ]; then
|
||||||
if [ -f /.dockerenv ] || [ -f /home/docs/omw_luadoc_docker ]; then
|
if [ -f /.dockerenv ] || [ -f /home/docs/omw_luadoc_docker ]; then
|
||||||
./install_luadocumentor_in_docker.sh
|
./install_luadocumentor_in_docker.sh
|
||||||
else
|
|
||||||
# running on Windows?
|
|
||||||
DOCUMENTOR_PATH="$APPDATA/LuaRocks/bin/openmwluadocumentor.bat"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -x $DOCUMENTOR_PATH ]; then
|
if [ ! command -v openmwluadocumentor &> /dev/null ]; then
|
||||||
echo "openmwluadocumentor not found; See README.md for installation instructions."
|
echo "openmwluadocumentor not found; See README.md for installation instructions."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
@ -23,9 +22,9 @@ rm -f $OUTPUT_DIR/*.html
|
||||||
data_paths=$($DOCS_SOURCE_DIR/luadoc_data_paths.sh)
|
data_paths=$($DOCS_SOURCE_DIR/luadoc_data_paths.sh)
|
||||||
|
|
||||||
cd $FILES_DIR/lua_api
|
cd $FILES_DIR/lua_api
|
||||||
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR openmw/*lua
|
openmwluadocumentor -f doc -d $OUTPUT_DIR openmw/*lua
|
||||||
cd $FILES_DIR/data
|
cd $FILES_DIR/data
|
||||||
for path in $data_paths
|
for path in $data_paths
|
||||||
do
|
do
|
||||||
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR $path
|
openmwluadocumentor -f doc -d $OUTPUT_DIR $path
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
if [ -z "$LUAROCKS" ]; then
|
|
||||||
echo "Requires the LUAROCKS variable to be set to the luarocks/bin directory, e. g. `~/.luarocks/bin`"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Takes a path to the output directory as the argument"
|
echo "Takes a path to the output directory as the argument"
|
||||||
exit
|
exit
|
||||||
|
@ -13,8 +8,9 @@ OPENMW_DIR=$(realpath $SCRIPTS_DIR/..)
|
||||||
DOCS_DIR=$(realpath $OPENMW_DIR/docs)
|
DOCS_DIR=$(realpath $OPENMW_DIR/docs)
|
||||||
FILES_DIR=$(realpath $OPENMW_DIR/files)
|
FILES_DIR=$(realpath $OPENMW_DIR/files)
|
||||||
OUTPUT_DIR=$(realpath "$1")
|
OUTPUT_DIR=$(realpath "$1")
|
||||||
DOCUMENTOR_PATH=$LUAROCKS/openmwluadocumentor
|
|
||||||
TEAL_PATH=$LUAROCKS/cyan
|
PATH=$PATH:~/lua-5.1.5/src
|
||||||
|
eval "$(luarocks path)"
|
||||||
|
|
||||||
rm -rf $OUTPUT_DIR
|
rm -rf $OUTPUT_DIR
|
||||||
mkdir $OUTPUT_DIR
|
mkdir $OUTPUT_DIR
|
||||||
|
@ -24,7 +20,7 @@ build_path() {
|
||||||
for file in $1
|
for file in $1
|
||||||
do
|
do
|
||||||
mkdir -p $OUTPUT_DIR/$(dirname $file)
|
mkdir -p $OUTPUT_DIR/$(dirname $file)
|
||||||
$DOCUMENTOR_PATH -f teal -d "$OUTPUT_DIR" $file
|
openmwluadocumentor -f teal -d "$OUTPUT_DIR" $file
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,4 +41,4 @@ rm -r lua_api
|
||||||
mv data/* ./
|
mv data/* ./
|
||||||
rm -r data
|
rm -r data
|
||||||
|
|
||||||
"$TEAL_PATH" check **/*.d.tl
|
cyan check **/*.d.tl
|
||||||
|
|
Loading…
Reference in a new issue