mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 06:38:13 +00:00
Summary: As recommended in https://circleci.com/docs/2.0/using-shell-scripts/#use-shellcheck It will only run on PRs for now. Pull Request resolved: https://github.com/facebook/react-native/pull/19681 Differential Revision: D10111711 Pulled By: hramos fbshipit-source-id: e980a526561dced79e5197a11cfb41a3eba9be8b
20 lines
680 B
Bash
Executable File
20 lines
680 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
IFS=$'\n'
|
|
|
|
results=( "$(find . -type f -not -path "*node_modules*" -not -path "*third-party*" -name '*.sh' -exec sh -c 'shellcheck "$1" -f json' -- {} \;)" )
|
|
|
|
cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | node bots/code-analysis-bot.js
|
|
|
|
# check status
|
|
STATUS=$?
|
|
if [ $STATUS == 0 ]; then
|
|
echo "Shell scripts analyzed successfully"
|
|
else
|
|
echo "Shell script analysis failed, error status $STATUS"
|
|
fi
|