atom-beautify/build-package.sh

67 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/bin/sh
2018-01-05 22:04:01 -07:00
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
2016-02-23 00:41:11 -07:00
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
export DISPLAY=":99"
fi
echo "Using Atom version:"
2018-01-05 22:04:01 -07:00
"$ATOM_SCRIPT_NAME" -v
2016-02-23 00:41:11 -07:00
echo "Using APM version:"
2018-01-05 22:04:01 -07:00
"$APM_SCRIPT_NAME" -v
echo "Downloading package dependencies..."
2018-01-05 22:04:01 -07:00
"$APM_SCRIPT_NAME" clean
"$APM_SCRIPT_NAME" install
2015-02-08 19:10:46 -07:00
2018-01-05 22:04:01 -07:00
echo "Installing atom package dependencies..."
"$APM_SCRIPT_NAME" install --packages-file atom-packages.txt
2015-02-08 19:10:46 -07:00
if [ -f ./node_modules/.bin/coffeelint ]; then
2016-02-23 03:30:49 -07:00
if [ -d ./src ]; then
2015-02-08 19:10:46 -07:00
echo "Linting package..."
2016-02-23 03:30:49 -07:00
./node_modules/.bin/coffeelint src
2016-02-23 00:41:11 -07:00
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
2015-02-08 19:10:46 -07:00
fi
if [ -d ./spec ]; then
echo "Linting package specs..."
./node_modules/.bin/coffeelint spec
2016-02-23 00:41:11 -07:00
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
2015-02-08 19:10:46 -07:00
fi
fi
2016-05-14 10:53:15 -06:00
if [ -f ./node_modules/.bin/eslint ]; then
if [ -d ./src ]; then
echo "Linting package..."
./node_modules/.bin/eslint src
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
fi
if [ -d ./spec ]; then
echo "Linting package specs..."
./node_modules/.bin/eslint spec
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
fi
fi
if [ -f ./node_modules/.bin/standard ]; then
if [ -d ./src ]; then
echo "Linting package..."
./node_modules/.bin/standard "src/**/*.js"
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
fi
if [ -d ./spec ]; then
echo "Linting package specs..."
./node_modules/.bin/standard "spec/**/*.js"
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
fi
fi
2016-02-23 00:41:11 -07:00
if [ -d ./spec ]; then
echo "Running specs..."
2018-01-05 22:04:01 -07:00
"$ATOM_SCRIPT_NAME" --test spec
2016-02-23 00:41:11 -07:00
else
echo "Missing spec folder! Please consider adding a test suite in `./spec`"
exit 1
fi
2018-01-05 22:04:01 -07:00
exit