Sha256: cd584a135109da625e78c6102963d8d5ed301c6eb2cad37c6582f7703866b45e

Contents?: true

Size: 1.64 KB

Versions: 94

Compression:

Stored size: 1.64 KB

Contents

#!/bin/bash --login
if [[ $MESHTASTIC_ROOT == '' ]]; then
  if [[ ! -d '/opt/meshtastic' ]]; then
    mesh_root=$(pwd)
  else
    mesh_root='/opt/meshtastic'
  fi
else
  mesh_root="${MESHTASTIC_ROOT}"
fi

ls pkg/*.gem 2> /dev/null | while read previous_gems; do 
  rvmsudo rm $previous_gems
done
old_ruby_version=`cat ${mesh_root}/.ruby-version`
# Default Strategy is to merge codebase
# rvmsudo git config pull.rebase false 
# rvmsudo git pull origin master
git config pull.rebase false 
git pull origin master
new_ruby_version=`cat ${mesh_root}/.ruby-version`

rvm list gemsets | grep `cat ${mesh_root}/.ruby-gemset`
if [[ $? != 0 ]]; then
  echo "Ruby v${new_ruby_version} is not installed.  Installing..."
  cd $mesh_root && ./upgrade_ruby.sh $new_ruby_version
  # Rely on RVM to creeate gemset
  cd / && cd $mesh_root
fi

if [[ $old_ruby_version == $new_ruby_version ]]; then
  export rvmsudo_secure_path=1
  rvmsudo /bin/bash --login -c "cd ${mesh_root} && ./reinstall_meshtastic_gemset.sh"
  rvmsudo rake
  rvmsudo rake install
  rvmsudo rake rerdoc
  rvmsudo gem update --system
  rvmsudo gem rdoc --rdoc --ri --overwrite -V meshtastic
  echo "Invoking bundle-audit Gemfile Scanner..."
  rvmsudo bundle-audit

  latest_gem=$(ls pkg/*.gem)
  if [[ $latest_gem != "" ]]; then
    echo "Pushing ${latest_gem} to RubyGems.org..."
    rvmsudo gem push $latest_gem --debug
  fi
else
  cd $mesh_root && ./upgrade_ruby.sh $new_ruby_version $old_ruby_version
fi

unpriv_user=`echo $USER`
if [[ $unpriv_user != 'root' ]]; then
  if [[ $(uname -s) == 'Darwin' ]]; then
    rvmsudo chown -R $unpriv_user $mesh_root
  else
    rvmsudo chown -R $unpriv_user:$unpriv_user $mesh_root
  fi
fi

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
meshtastic-0.0.120 build_meshtastic_gem.sh
meshtastic-0.0.119 build_meshtastic_gem.sh
meshtastic-0.0.118 build_meshtastic_gem.sh
meshtastic-0.0.117 build_meshtastic_gem.sh
meshtastic-0.0.116 build_meshtastic_gem.sh
meshtastic-0.0.115 build_meshtastic_gem.sh
meshtastic-0.0.114 build_meshtastic_gem.sh
meshtastic-0.0.113 build_meshtastic_gem.sh
meshtastic-0.0.112 build_meshtastic_gem.sh
meshtastic-0.0.111 build_meshtastic_gem.sh
meshtastic-0.0.110 build_meshtastic_gem.sh
meshtastic-0.0.109 build_meshtastic_gem.sh
meshtastic-0.0.108 build_meshtastic_gem.sh
meshtastic-0.0.107 build_meshtastic_gem.sh
meshtastic-0.0.106 build_meshtastic_gem.sh
meshtastic-0.0.105 build_meshtastic_gem.sh
meshtastic-0.0.104 build_meshtastic_gem.sh
meshtastic-0.0.103 build_meshtastic_gem.sh
meshtastic-0.0.102 build_meshtastic_gem.sh
meshtastic-0.0.101 build_meshtastic_gem.sh