#!/usr/bin/env bash


op_script=$HOME/tmp_results/shells/python_return_command.sh
if [ -f "$op_script" ]; then
  rm $op_script
fi

source ~/code/machineconfig/.venv/bin/activate

python -m machineconfig.scripts.python.croshell "$@"
# python $(dirname $(dirname $0))/python/fire_jobs.py "$@"


if [ -f "$op_script" ]; then
  chmod +x $op_script
  set --  # clear all positional parameters
  source $op_script  # sourcing the script means the args passed to the this script are passed to the sourced script which cofuses the sources script as it contains activate_ve and it doesn't understand first.sh arguments.
fi

# check below if VIRTUAL_ENV enviroment variable exist, then deactivate it, otherwise skip
if [ -n "$VIRTUAL_ENV" ]; then
  deactivate || true
fi
