From 79dc8d8fbe5a7397f40c543cd42c23f88b565460 Mon Sep 17 00:00:00 2001 From: Steven Bell Date: Tue, 23 Apr 2019 22:26:17 -0500 Subject: [PATCH 1/2] Initial commit Initial commit for rpi0 testing --- bin/oref0-setup.sh | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index e4f7b4f60..3b95cd355 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -111,8 +111,8 @@ case $i in -ht=*|--hardwaretype=*) hardwaretype="${i#*=}" ;; - -npm=*|--npm_install=*) - npm_option="${i#*=}" + -yarn=*|--yarn_install=*) + yarn_option="${i#*=}" shift ;; *) @@ -678,7 +678,7 @@ if prompt_yn "" N; then echo Upgrading to node 8 # Use nodesource setup script to add nodesource repository to sources.list.d sudo bash -c "curl -sL https://deb.nodesource.com/setup_8.x | bash -" || die "Couldn't setup node 8" - # Install nodejs and npm from nodesource + # Install nodejs and yarn from nodesource sudo apt-get install -y nodejs || die "Couldn't install nodejs" fi @@ -741,11 +741,11 @@ if prompt_yn "" N; then echo Checking oref0 installation cd $HOME/src/oref0 if git branch | grep "* master"; then - npm list -g --depth=0 | egrep oref0@0.6.[0] || (echo Installing latest oref0 package && sudo npm install -g oref0) - elif [[ ${npm_option,,} == "force" ]]; then - echo Forcing install of latest oref0 from $HOME/src/oref0/ && cd $HOME/src/oref0/ && npm run global-install + yarn list -g --depth=0 | egrep oref0@0.6.[0] || (echo Installing latest oref0 package && yarn install -g oref0) + elif [[ ${yarn_option,,} == "force" ]]; then + echo Forcing install of latest oref0 from $HOME/src/oref0/ && cd $HOME/src/oref0/ && yarn run global-install else - npm list -g --depth=0 | egrep oref0@0.6.[1-9] || (echo Installing latest oref0 from $HOME/src/oref0/ && cd $HOME/src/oref0/ && npm run global-install) + yarn list -g --depth=0 | egrep oref0@0.6.[1-9] || (echo Installing latest oref0 from $HOME/src/oref0/ && cd $HOME/src/oref0/ && yarn run global-install) fi cd $directory || die "Can't cd $directory" @@ -1125,7 +1125,7 @@ if prompt_yn "" N; then echo xdrip-js selected as CGM, so configuring xdrip-js git clone https://github.com/xdrip-js/Logger.git $HOME/src/Logger cd $HOME/src/Logger - sudo npm run global-install + yarn run global-install touch /tmp/reboot-required fi @@ -1254,7 +1254,7 @@ if prompt_yn "" N; then else cd $HOME/src && git clone git://github.com/openaps/openaps-menu.git || (cd openaps-menu && git checkout master && git pull) fi - cd $HOME/src/openaps-menu && sudo npm install + cd $HOME/src/openaps-menu && yarn install cp $HOME/src/openaps-menu/openaps-menu.service /etc/systemd/system/ && systemctl enable openaps-menu fi diff --git a/package.json b/package.json index ee3958bc8..18a85bfe2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "openaps oref0 reference implementation of the reference design", "scripts": { "test": "make test", - "global-install": "npm install && sudo npm link && sudo npm link oref0 && sudo npm install -g && npm install -g" + "global-install": "yarn install && yarn link && yarn link oref0 && yarn install -g" }, "repository": { "type": "git", From 3d619b405897116545f72fbde8e7c2b00eedc0ca Mon Sep 17 00:00:00 2001 From: Steven Bell Date: Tue, 23 Apr 2019 23:49:45 -0500 Subject: [PATCH 2/2] Update initial pull --- Makefile | 4 ++-- README.md | 6 +++--- bin/openaps-packages.sh | 7 ++++--- bin/openaps-src.sh | 13 +++++++------ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 339ddc79c..8a890166d 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,9 @@ travis: report: test -f ${ANALYZED} && \ - (npm install coveralls && cat ${ANALYZED} | \ + (yarn install coveralls && cat ${ANALYZED} | \ ./node_modules/.bin/coveralls) || echo "NO COVERAGE" test -f ${ANALYZED} && \ - (npm install codacy-coverage && cat ${ANALYZED} | \ + (yarn install codacy-coverage && cat ${ANALYZED} | \ YOURPACKAGE_COVERAGE=1 ./node_modules/codacy-coverage/bin/codacy-coverage.js) || echo "NO COVERAGE" diff --git a/README.md b/README.md index 3644bdfed..76dbb0344 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Algorithm for OpenAPS implementations. To get started with OpenAPS, see the [Ope Install tools globally: -`npm run global-install` +`yarn install` ## Usage of oref0 @@ -94,9 +94,9 @@ git checkout -b wip/my-enhancement-fix-or-proposal ``` This command installs new versions from source: -`sudo npm install -g` +`yarn install -g` -Alternately, `sudo npm link` or `sudo npm link oref0` should allow you to +Alternately, `yarn link` or `yarn link oref0` should allow you to edit from your checkout while using your checkout globally on your system. ### Fork on github. diff --git a/bin/openaps-packages.sh b/bin/openaps-packages.sh index 5e4d89500..ad3d237b0 100755 --- a/bin/openaps-packages.sh +++ b/bin/openaps-packages.sh @@ -26,8 +26,9 @@ if ! nodejs --version | grep -e 'v8\.' -e 'v1[02468]\.' &> /dev/null ; then sudo bash -c "curl -sL https://deb.nodesource.com/setup_8.x | bash -" || die "Couldn't setup node 8" sudo apt-get install -y nodejs || die "Couldn't install nodejs" else - sudo apt-get install -y nodejs npm || die "Couldn't install nodejs and npm" - npm install npm@latest -g || die "Couldn't update npm" + sudo apt-get install -y nodejs || die "Couldn't install nodejs" + sudo curl -o- -L https://yarnpkg.com/install.sh | bash || die "Couldn't install yarn" + sudo yarn install || die "Couldn't update yarn" fi ## You may also need development tools to build native addons: ##sudo apt-get install gcc g++ make @@ -37,6 +38,6 @@ sudo pip install -U openaps || die "Couldn't install openaps toolkit" sudo pip install -U openaps-contrib || die "Couldn't install openaps-contrib" sudo openaps-install-udev-rules || die "Couldn't run openaps-install-udev-rules" sudo activate-global-python-argcomplete || die "Couldn't run activate-global-python-argcomplete" -sudo npm install -g json || die "Couldn't install npm json" +sudo yarn install -g json || die "Couldn't install yarn json" echo openaps installed openaps --version diff --git a/bin/openaps-src.sh b/bin/openaps-src.sh index a564a98ae..aec4bbcc6 100755 --- a/bin/openaps-src.sh +++ b/bin/openaps-src.sh @@ -12,9 +12,10 @@ EOT apt-get install -y sudo sudo apt-get update -sudo apt-get install -y git python python-dev python-software-properties python-numpy python-pip nodejs-legacy npm watchdog strace tcpdump screen acpid vim locate jq lm-sensors && \ +sudo apt-get install -y git python python-dev python-software-properties python-numpy python-pip nodejs-legacy watchdog strace tcpdump screen acpid vim locate jq lm-sensors && \ ( curl -s https://bootstrap.pypa.io/ez_setup.py | sudo python ) && \ -sudo npm install -g json && \ +( curl -o- -L https://yarnpkg.com/install.sh | bash ) && \ +sudo yarn install -g json && \ sudo easy_install -ZU setuptools && \ mkdir ~/src cd ~/src && \ @@ -44,10 +45,10 @@ cd ~/src && \ ) test -d oref0 && \ cd oref0 && \ -npm install && \ -sudo npm install -g && \ -sudo npm link && \ -sudo npm link oref0 +yarn install && \ +sudo yarn install -g && \ +sudo yarn link && \ +sudo yarn link oref0 sudo openaps-install-udev-rules && \ sudo activate-global-python-argcomplete && \