Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Add Yarn support #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ image_config: &image_config

NODE_VERSION_NUM: # pick a version from https://nodejs.org/dist

YARN: # Yarn options: true, false

PYTHON_VERSION_NUM: # pick a version from https://python.org/ftp/python

JAVA: # Java options: true, false
Expand Down
7 changes: 7 additions & 0 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ if [ ! -e $NODE_VERSION_NUM ] ; then
rm -r node-v$NODE_VERSION_NUM"
fi

if [ $YARN = "true" ] ; then
echo "RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -"
echo "RUN echo \"deb https://dl.yarnpkg.com/debian/ stable main\" | tee /etc/apt/sources.list.d/yarn.list"
echo "RUN apt-get -y install apt-transport-https "
echo "RUN apt-get update && apt-get -y install yarn"
fi

if [ ! -e $PYTHON_VERSION_NUM ] ; then
echo "RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION_NUM/Python-$PYTHON_VERSION_NUM.tgz && \
tar xzf Python-$PYTHON_VERSION_NUM.tgz && \
Expand Down
14 changes: 14 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ else
perl -i -pe "s/- run: node/# - run: node/" .circleci/config.yml
fi

read -r -p "
Does your project need Yarn? Enter the word 'yes' to install Yarn or hit enter to skip installing Yarn
: " YARN

case "$YARN" in
yes)
perl -i -pe 's/# Yarn options: true, false/true/' .circleci/config.yml
;;
*)
perl -i -pe 's/# Yarn options: true, false/false/' .circleci/config.yml
perl -i -pe "s/- run: yarn/# - run: yarn/" .circleci/config.yml
;;
esac

read -r -p "
Pick a Python version from https://python.org/ftp/python, or hit enter to skip installing Python
: " PYTHON_VERSION_NUM
Expand Down
8 changes: 8 additions & 0 deletions scripts/tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
node --version | grep $NODE_VERSION_NUM
}

@test "yarn" {
if [ $YARN != "true" ] ; then
skip "yarn not installed"
fi

yarn --version
}

@test "ruby version" {
if [ -e $RUBY_VERSION_NUM ] ; then
skip "ruby not installed"
Expand Down