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.84 upgrade_ruby.sh
meshtastic-0.0.83 upgrade_ruby.sh
meshtastic-0.0.82 upgrade_ruby.sh
meshtastic-0.0.81 upgrade_ruby.sh
meshtastic-0.0.80 upgrade_ruby.sh
meshtastic-0.0.79 upgrade_ruby.sh
meshtastic-0.0.78 upgrade_ruby.sh
meshtastic-0.0.77 upgrade_ruby.sh
meshtastic-0.0.76 upgrade_ruby.sh
meshtastic-0.0.75 upgrade_ruby.sh
meshtastic-0.0.74 upgrade_ruby.sh
meshtastic-0.0.73 upgrade_ruby.sh
meshtastic-0.0.72 upgrade_ruby.sh
meshtastic-0.0.71 upgrade_ruby.sh
meshtastic-0.0.70 upgrade_ruby.sh
meshtastic-0.0.69 upgrade_ruby.sh
meshtastic-0.0.68 upgrade_ruby.sh
meshtastic-0.0.67 upgrade_ruby.sh
meshtastic-0.0.42 upgrade_ruby.sh
meshtastic-0.0.41 upgrade_ruby.sh