-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-brew-style.sh
More file actions
executable file
·34 lines (29 loc) · 990 Bytes
/
test-brew-style.sh
File metadata and controls
executable file
·34 lines (29 loc) · 990 Bytes
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
#!/bin/bash
set -e
# Check if Homebrew is installed
if ! command -v brew &> /dev/null
then
echo "Homebrew is not installed. Please install it first."
echo "You can install Homebrew from: https://brew.sh/"
exit 1
fi
# Create a temporary directory for testing
TEST_DIR=$(mktemp -d)
echo "Created test directory: $TEST_DIR"
cd "$TEST_DIR"
# Download the Homebrew formula file
FORMULA_URL="https://raw.githubusercontent.com/openSVM/lessvm/main/lessvm.rb"
FORMULA_FILE="lessvm.rb"
echo "Downloading Homebrew formula..."
if ! curl -v -sSL -o "$FORMULA_FILE" "$FORMULA_URL"; then
echo "Error: Failed to download Homebrew formula from $FORMULA_URL"
exit 1
fi
# Run brew style
echo "Running brew style..."
brew update
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "$FORMULA_FILE" || true
# Clean up
cd -
echo "Test completed. Check the output for any style violations."
echo "You can remove the test directory with: rm -rf $TEST_DIR"