Check for required binaries
This commit is contained in:
@@ -37,6 +37,26 @@ else
|
|||||||
NVIM_OS="linux"
|
NVIM_OS="linux"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
NVIM_REQUIRED_BINARIES=(
|
||||||
|
cmake
|
||||||
|
curl
|
||||||
|
fz
|
||||||
|
g++
|
||||||
|
gcc
|
||||||
|
git
|
||||||
|
make
|
||||||
|
node
|
||||||
|
npm
|
||||||
|
rg
|
||||||
|
rsync
|
||||||
|
sed
|
||||||
|
shfmt
|
||||||
|
tar
|
||||||
|
unzip
|
||||||
|
wget
|
||||||
|
zip
|
||||||
|
)
|
||||||
|
|
||||||
function create_link() {
|
function create_link() {
|
||||||
local cur
|
local cur
|
||||||
local res
|
local res
|
||||||
@@ -55,6 +75,16 @@ function error_exit() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_binary() {
|
||||||
|
if command -v "$1" >/dev/null 2>&1; then
|
||||||
|
error_exit "failed to find required binary: $1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
for BINARY in "${NVIM_REQUIRED_BINARIES[@]}"; do
|
||||||
|
check_binary "$BINARY"
|
||||||
|
done
|
||||||
|
|
||||||
pushd "${SCRIPT_DIR}" 1>/dev/null 2>&1 || error_exit "failed to push: ${SCRIPT_DIR}"
|
pushd "${SCRIPT_DIR}" 1>/dev/null 2>&1 || error_exit "failed to push: ${SCRIPT_DIR}"
|
||||||
FNAME=cpptools-${NVIM_OS}-${NVIM_ARCH2}.vsix
|
FNAME=cpptools-${NVIM_OS}-${NVIM_ARCH2}.vsix
|
||||||
if [ ! -f "dap/${FNAME}" ]; then
|
if [ ! -f "dap/${FNAME}" ]; then
|
||||||
@@ -93,5 +123,6 @@ popd 1>/dev/null 2>&1 || error_exit "failed to popd: ${SCRIPT_DIR}"
|
|||||||
export NVIM_ARCH
|
export NVIM_ARCH
|
||||||
export NVIM_ARCH2
|
export NVIM_ARCH2
|
||||||
export NVIM_CPPTOOLS_VERSION
|
export NVIM_CPPTOOLS_VERSION
|
||||||
export NVIM_VERSION
|
|
||||||
export NVIM_OS
|
export NVIM_OS
|
||||||
|
export NVIM_REQUIRED_BINARIES
|
||||||
|
export NVIM_VERSION
|
||||||
|
|||||||
Reference in New Issue
Block a user