forked from ddev/ddev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.envrc
More file actions
37 lines (31 loc) · 1.5 KB
/
.envrc
File metadata and controls
37 lines (31 loc) · 1.5 KB
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
#!/usr/bin/env bash
# Direnv bootstrap for DDEV development
# 1) Install direnv and hook into your shell. 2) (Optional) whitelist this file in ~/.config/direnv/direnv.toml
# When you cd into this dir, DDEV binaries and development tools are added to PATH.
set -euo pipefail
# Pre-reqs
if ! command -v go >/dev/null 2>&1; then
echo "Go is not available." >&2; exit 1
fi
mkdir -p .gotmp/bin
# Prepend ddev build bin to PATH
BIN_DIR="$PWD/.gotmp/bin/$(go env GOHOSTOS)_$(go env GOHOSTARCH)"
export PATH="$BIN_DIR:$PATH"
# Add global development tools to PATH if they exist
DEV_TOOLS_DIR="$HOME/.ddev-dev-tools"
if [[ -d "$DEV_TOOLS_DIR/python/bin" && -d "$DEV_TOOLS_DIR/node/bin" ]]; then
export PATH="$DEV_TOOLS_DIR/python/bin:$DEV_TOOLS_DIR/node/bin:$PATH"
else
# Check if any development tools are missing and show helpful message
missing_tools=()
if ! command -v mkdocs >/dev/null 2>&1; then missing_tools+=("mkdocs"); fi
if ! command -v pyspelling >/dev/null 2>&1; then missing_tools+=("pyspelling"); fi
if ! command -v markdownlint >/dev/null 2>&1; then missing_tools+=("markdownlint"); fi
if ! command -v textlint >/dev/null 2>&1; then missing_tools+=("textlint"); fi
if ! command -v linkspector >/dev/null 2>&1; then missing_tools+=("linkspector"); fi
if [[ ${#missing_tools[@]} -gt 0 ]]; then
echo "📝 Missing development tools: ${missing_tools[*]}"
echo " Install them with: scripts/install-dev-tools.sh"
echo " Or see: https://docs.ddev.com/en/stable/developers/testing-docs/"
fi
fi