<commit_before>#!/bin/bash
# updates Enaml

# ARCH can be either linux or osx at the moment.

download_omg(){
  local i

  echo "Upgrading from version $omg_existing_version to $omg_ghub_version."
  echo "Downloading Enaml omg and cloud-configs..."
  cd $CCONF
  for i in \
      $(curl -s "https://api.github.com/repos/enaml-ops/omg-cli/releases/latest" \
      | jq --raw-output '.assets[] | .browser_download_url' | grep $ARCH); do
  wget -q $i -O $(basename $i)
  done
  chmod +x omg-$ARCH
  mv omg-$ARCH "$OMGBIN/omg-$ARCH"
  ln -f -s "$OMGBIN/omg-$ARCH" "$OMGBIN/omg"
}

download_products(){
  local i

  echo "Upgrading from version $prod_existing_version to $prod_ghub_version."
  echo "Downloading Enaml products..."
  cd $PROD
  for i in $(curl -s "https://api.github.com/repos/enaml-ops/omg-product-bundle/releases/latest" \
      |jq --raw-output '.assets[] | .browser_download_url' | grep $ARCH); do
  wget -q $i -O $(basename $i)
  done
}

register_cloudconfigs(){
  cd $HOME
  echo "Registering cloud configs..."
  find $CCONF -type f -print | while read i; do \
       $OMGBIN/omg register-plugin -type cloudconfig -pluginpath $i
  done
}

register_products(){
  cd $HOME
  echo "Registering products..."
  find $PROD -type f -print | while read i; do
       $OMGBIN/omg register-plugin -type product -pluginpath $i
  done
}

#######
# Main
#######

if [ -z "$ENAML" ]; then
  echo "Please set the \$ENAML variable. This is the directory where Enaml will be installed. This program will overwrite that directory."
  exit 1
fi

if [ -z "$OMG_PLUGIN_DIR" ]; then
  OMG_PLUGIN_DIR=$HOME
  echo \$OMG_PLUGIN_DIR not specified. Set to $HOME.
fi

ARCH=linux
PROD=$ENAML/products<commit_msg>update_enaml.sh now supports OMG_PLUGIN_DIR variable<commit_after>#!/bin/bash
# updates Enaml

# ARCH can be either linux or osx at the moment.

download_omg(){
  local i

  echo "Upgrading from version $omg_existing_version to $omg_ghub_version."
  echo "Downloading Enaml omg and cloud-configs..."
  cd $CCONF
  for i in \
      $(curl -s "https://api.github.com/repos/enaml-ops/omg-cli/releases/latest" \
      | jq --raw-output '.assets[] | .browser_download_url' | grep $ARCH); do
  wget -q $i -O $(basename $i)
  done
  chmod +x omg-$ARCH
  mv omg-$ARCH "$OMGBIN/omg-$ARCH"
  ln -f -s "$OMGBIN/omg-$ARCH" "$OMGBIN/omg"
}

download_products(){
  local i

  echo "Upgrading from version $prod_existing_version to $prod_ghub_version."
  echo "Downloading Enaml products..."
  cd $PROD
  for i in $(curl -s "https://api.github.com/repos/enaml-ops/omg-product-bundle/releases/latest" \
      |jq --raw-output '.assets[] | .browser_download_url' | grep $ARCH); do
  wget -q $i -O $(basename $i)
  done
}

register_cloudconfigs(){
  cd $OMG_PLUGIN_DIR
  echo "Registering cloud configs..."
  find $CCONF -type f -print | while read i; do \
       $OMGBIN/omg register-plugin -type cloudconfig -pluginpath $i
  done
}

register_products(){
  cd $OMG_PLUGIN_DIR
  echo "Registering products..."
  find $PROD -type f -print | while read i; do
       $OMGBIN/omg register-plugin -type product -pluginpath $i
  done
}

#######
# Main
#######

if [ -z "$ENAML" ]; then
  echo "Please set the \$ENAML variable. This is the directory where Enaml will be installed. This program will overwrite that directory."
  exit 1
fi

if [ -z "$OMG_PLUGIN_DIR" ]; then
  OMG_PLUGIN_DIR=$HOME
  echo \$OMG_PLUGIN_DIR not specified. Set to $HOME.
fi

ARCH=linux
PROD=$ENAML/products
{'fraction_non_alphanumeric': 0.13674472390864412, 'fraction_numerical': 0.0005782017924255566, 'mean_word_length': 3.2610837438423643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '570751', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1262, 'n_words': 377}