File: run-yarn-test.sh

package info (click to toggle)
node-yarnpkg 1.13.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 93,036 kB
  • sloc: sh: 323; makefile: 19
file content (25 lines) | stat: -rwxr-xr-x 591 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
# Executed within a fresh Docker container to test execution of Yarn.
# Should be executed after Yarn has been installed.
set -ex

fail_with_log() {
  # Include the yarn-error.log file in the output, if available
  exitcode=$?
  if [ -s yarn-error.log ]; then
    cat yarn-error.log
  fi;
  exit $exitcode
}

cd /tmp
mkdir yarntest
cd yarntest
echo {} > package.json

# Create the cache directory and remove it
# This simulates issue reported here: https://github.com/yarnpkg/yarn/issues/1724
yarn --version || fail_with_log
rm -rf ~/.cache/yarn

yarn add react || fail_with_log