42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# 1. Install system compilers, libraries, and package managers
|
|
# Note: Debian/Ubuntu packages npm separately from nodejs and names Clang headers libclang-dev
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
pkg-config \
|
|
clang \
|
|
libclang-dev \
|
|
graphviz \
|
|
pipx \
|
|
nodejs \
|
|
npm -qq
|
|
|
|
# 2. Add local tool paths to ~/.bashrc and active shell
|
|
pipx ensurepath
|
|
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
|
|
grep -q 'export PATH="\$HOME/.cargo/bin:\$HOME/.local/bin:\$PATH"' ~/.bashrc || \
|
|
echo 'export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"' >> ~/.bashrc
|
|
|
|
# 3. Install CLI binaries
|
|
# Cargo compiles native Tree-sitter using libclang-dev
|
|
cargo install tree-sitter-cli
|
|
pipx install semgrep
|
|
pipx install mutmut
|
|
|
|
# Handle global npm install (avoids sudo if running under nvm)
|
|
if command -v nvm >/dev/null 2>&1 || [ -n "$NVM_DIR" ]; then
|
|
npm install -g @sourcegraph/scip-typescript madge @stryker-mutator/core
|
|
else
|
|
sudo npm install -g @sourcegraph/scip-typescript madge @stryker-mutator/core
|
|
fi
|
|
|
|
# 4. Verify all commands exist
|
|
tree-sitter --version && \
|
|
semgrep --version && \
|
|
scip-typescript --version && \
|
|
madge --version && \
|
|
mutmut --version
|