|
27 | 27 | PACKAGE_DIR="${SRCROOT}" |
28 | 28 | fi |
29 | 29 |
|
30 | | -# Detect OS and set paths accordingly |
31 | | -if [ "$(uname)" = "Darwin" ]; then |
32 | | - DEFAULT_MINT_PATH="/opt/homebrew/bin/mint" |
33 | | -elif [ "$(uname)" = "Linux" ] && [ -n "$GITHUB_ACTIONS" ]; then |
34 | | - DEFAULT_MINT_PATH="$GITHUB_WORKSPACE/Mint/.mint/bin/mint" |
35 | | -elif [ "$(uname)" = "Linux" ]; then |
36 | | - DEFAULT_MINT_PATH="/usr/local/bin/mint" |
37 | | -else |
38 | | - echo "Unsupported operating system" |
39 | | - exit 1 |
40 | | -fi |
41 | | - |
42 | | -# Use environment MINT_CMD if set, otherwise use default path |
43 | | -MINT_CMD=${MINT_CMD:-$DEFAULT_MINT_PATH} |
44 | | - |
45 | | -export MINT_PATH="$PACKAGE_DIR/.mint" |
46 | | -MINT_ARGS="-n -m $PACKAGE_DIR/Mintfile --silent" |
47 | | -MINT_RUN="$MINT_CMD run $MINT_ARGS" |
48 | | - |
49 | 30 | if [ "$LINT_MODE" = "NONE" ]; then |
50 | 31 | exit |
51 | 32 | elif [ "$LINT_MODE" = "STRICT" ]; then |
52 | 33 | SWIFTFORMAT_OPTIONS="--strict --configuration .swift-format" |
53 | 34 | SWIFTLINT_OPTIONS="--strict" |
54 | 35 | STRINGSLINT_OPTIONS="--config .strict.stringslint.yml" |
55 | | -else |
| 36 | +else |
56 | 37 | SWIFTFORMAT_OPTIONS="--configuration .swift-format" |
57 | 38 | SWIFTLINT_OPTIONS="" |
58 | 39 | STRINGSLINT_OPTIONS="--config .stringslint.yml" |
59 | 40 | fi |
60 | 41 |
|
61 | | -pushd $PACKAGE_DIR |
62 | | -run_command $MINT_CMD bootstrap -m Mintfile |
| 42 | +pushd "$PACKAGE_DIR" |
| 43 | +if [ -z "$CI" ]; then |
| 44 | + mise install |
| 45 | +fi |
| 46 | +if command -v mise &> /dev/null; then |
| 47 | + eval "$(mise env)" |
| 48 | +fi |
63 | 49 |
|
64 | 50 | if [ -z "$CI" ]; then |
65 | | - run_command $MINT_RUN swift-format format $SWIFTFORMAT_OPTIONS --recursive --parallel --in-place Sources Tests |
66 | | - run_command $MINT_RUN swiftlint --fix |
| 51 | + run_command swift-format format $SWIFTFORMAT_OPTIONS --recursive --parallel --in-place Sources Tests |
| 52 | + run_command swiftlint --fix |
67 | 53 | fi |
68 | 54 |
|
69 | 55 | if [ -z "$FORMAT_ONLY" ]; then |
70 | | - run_command $MINT_RUN swift-format lint --configuration .swift-format --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests |
71 | | - run_command $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS |
| 56 | + run_command swift-format lint --configuration .swift-format --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests |
| 57 | + run_command swiftlint lint $SWIFTLINT_OPTIONS |
72 | 58 | fi |
73 | 59 |
|
74 | | -$PACKAGE_DIR/Scripts/header.sh -d $PACKAGE_DIR/Sources -c "Leo Dion" -o "BrightDigit" -p "SyntaxKit" |
| 60 | +$PACKAGE_DIR/Scripts/header.sh -d $PACKAGE_DIR/Sources -c "Leo Dion" -o "BrightDigit" -p "SyntaxKit" -y 2025 |
75 | 61 |
|
76 | | -run_command $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS |
77 | | -run_command $MINT_RUN swift-format lint --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests |
| 62 | +run_command swiftlint lint $SWIFTLINT_OPTIONS |
| 63 | +run_command swift-format lint --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests |
78 | 64 |
|
79 | 65 | if [ -z "$CI" ]; then |
80 | | - run_command $MINT_RUN periphery scan $PERIPHERY_OPTIONS --disable-update-check |
| 66 | + run_command periphery scan $PERIPHERY_OPTIONS --disable-update-check |
81 | 67 | fi |
82 | 68 |
|
83 | 69 |
|
|
0 commit comments