abinfo "Installing build dependency ..."
npm i

abinfo "Building code-server ..."
npm run build
pushd "$SRCDIR"/lib/vscode
npm ci
popd
npm run build:vscode
npm run release
npm run release:standalone

abinfo "Installing code-server ..."
mkdir -pv "$PKGDIR"/usr/lib/code-server
cp -avr "$SRCDIR"/release-standalone/* "$PKGDIR"/usr/lib/code-server

abinfo "linking code-server to /usr/bin ..."
mkdir -pv "$PKGDIR"/usr/bin
ln -sv ../lib/code-server/bin/code-server "$PKGDIR"/usr/bin/code-server
