Sha256: 98ecae392c8d5fc2903f87d7d89a718e588bed6cff376d51ac9330b1791c0150

Contents?: true

Size: 1.01 KB

Versions: 58

Compression:

Stored size: 1.01 KB

Contents

#!/bin/bash --login
# USE THIS SCRIPT WHEN UPGRADING RUBY
if [[ $MESHTASTIC_ROOT == '' ]]; then
  if [[ ! -d '/opt/meshtastic' ]]; then
    meshtastic_root=$(pwd)
  else
    meshtastic_root='/opt/meshtastic'
  fi
else
  meshtastic_root="${MESHTASTIC_ROOT}"
fi

function usage() {
  echo $"Usage: $0 <new ruby version e.g. 2.4.4> <optional bool running from build_meshtastic_gem.sh>"
  exit 1
}

if [[ -f '/etc/profile.d/rvm.sh' ]]; then
  source /etc/profile.d/rvm.sh
fi

new_ruby_version=$1
if [[ $2 != '' ]]; then
  old_ruby_version=$2
else
  old_ruby_version=`cat ${meshtastic_root}/.ruby-version`
fi

ruby_gemset=`cat ${meshtastic_root}/.ruby-gemset`

if [[ $# < 1 ]]; then
  usage
fi

# Upgrade RVM
export rvmsudo_secure_path=1
rvmsudo rvm get head
rvm reload

# Install New Version of RubyGems & Ruby
cd $meshtastic_root && ./upgrade_gem.sh
rvmsudo rvm install ruby-$new_ruby_version
echo $new_ruby_version > $meshtastic_root/.ruby-version

cd $meshtastic_root && rvm use $new_ruby_version@$ruby_gemset && ./build_meshtastic_gem.sh

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
meshtastic-0.0.20 upgrade_ruby.sh
meshtastic-0.0.19 upgrade_ruby.sh
meshtastic-0.0.18 upgrade_ruby.sh
meshtastic-0.0.17 upgrade_ruby.sh
meshtastic-0.0.16 upgrade_ruby.sh
meshtastic-0.0.15 upgrade_ruby.sh
meshtastic-0.0.14 upgrade_ruby.sh
meshtastic-0.0.13 upgrade_ruby.sh
meshtastic-0.0.12 upgrade_ruby.sh
meshtastic-0.0.11 upgrade_ruby.sh
meshtastic-0.0.10 upgrade_ruby.sh
meshtastic-0.0.9 upgrade_ruby.sh
meshtastic-0.0.8 upgrade_ruby.sh
meshtastic-0.0.7 upgrade_ruby.sh
meshtastic-0.0.6 upgrade_ruby.sh
meshtastic-0.0.5 upgrade_ruby.sh
meshtastic-0.0.4 upgrade_ruby.sh
meshtastic-0.0.3 upgrade_ruby.sh