-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnexus-cli
More file actions
executable file
·37 lines (29 loc) · 1.11 KB
/
nexus-cli
File metadata and controls
executable file
·37 lines (29 loc) · 1.11 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
# nexus-cli wrapper script
# Provides convenient access to the Project Nexus CLI management tool
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Change to the project root directory
cd "$SCRIPT_DIR"
# Check if pnpm is available
if ! command -v pnpm &> /dev/null; then
echo "Error: pnpm is not installed or not in PATH"
echo ""
echo "Please install pnpm:"
echo " npm install -g pnpm"
echo ""
echo "Or use the full command:"
echo " npx pnpm --filter nexus-backend exec tsx src/cli.ts $*"
exit 1
fi
# Execute the CLI with all arguments passed through
# Filter out pnpm's confusing error messages
STDOUT_TMP=$(mktemp)
STDERR_TMP=$(mktemp)
trap "rm -f $STDOUT_TMP $STDERR_TMP" EXIT
pnpm --filter nexus-backend exec tsx src/cli.ts "$@" >"$STDOUT_TMP" 2>"$STDERR_TMP"
EXIT_CODE=$?
# Filter and show output, removing pnpm noise
grep -v -E "(ERR_PNPM|^undefined$|^/.*apps/backend:$|^ ERR_PNPM)" "$STDOUT_TMP" || true
grep -v -E "(ERR_PNPM|^undefined$|^/.*apps/backend:$|^ ERR_PNPM)" "$STDERR_TMP" >&2 || true
exit $EXIT_CODE