"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "d9d47174463dd2d185337c7787a0b88be9460336"
install_precommit.sh 449 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

run_and_check() {
    "$@"
    status=$?
    if [ $status -ne 0 ]; then
        echo "Error with \"$@\": Exited with status $status"
        exit $status
    fi
    return $status
}

echo "I: Installing tools required for pre-commit checks..."
14
run_and_check apt install clang-format-12
15
16
17
18
19
20

echo "I: Installing pre-commit itself..."
run_and_check pip3 install pre-commit
run_and_check pre-commit install

echo "I: Installation successful."