summaryrefslogtreecommitdiff
path: root/osx.sh
blob: b56c7fa12f2d94a347637db43e74e30ca81c41bd (plain)
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
40
41
42
#!/bin/bash

set -e

MY_DIR=$(cd "$(dirname $0)";pwd)
cd $MY_DIR

echo "updating submodule ..."
git submodule -q update --recursive --init

echo "build luamake ..."
cd 3rd/luamake
ninja -f ninja/macos.ninja
cd -

./3rd/luamake/luamake

cd server
mv bin/*.so .
./bin/lua-language-server publish.lua
cd -

cp server/*.so publish/lua-language-server/server/

echo "Try to install lua-language-server for you:"
INSTALL_PATH=`find ~/.vscode/extensions -name "sumneko.lua-*" | sort -r | head -1`

if [ -d "$INSTALL_PATH" ]; then
    cp server/bin/lua-language-server "${INSTALL_PATH}/server/bin"

    cp server/*.so "${INSTALL_PATH}/server"

    echo "installed."
    echo "please restart VScode and enjoy."
    echo "Done."
else
    echo "please install sumneko Lua in VScode Marketplace first."
    exit 1
fi

#cd publish/lua-language-server
#vsce package