package travix.commands;

import tink.cli.Rest;

class PythonCommand extends Command {

  public function install() {
    
  }

  public function buildAndRun(rest:Rest<String>) {
    build('python', ['-python', 'bin/python/tests.py'].concat(rest), function () {
      if (tryToRun('python3', ['--version']).match(Failure(_, _))) {
        installPackage('python3');
      }
      exec('python3', ['bin/python/tests.py']);
    });
  }
}

package travix.commands;

import tink.cli.Rest;

class PythonCommand extends Command {

  public function install() {
    
  }

  public function buildAndRun(rest:Rest<String>) {
    build('python', ['-python', 'bin/python/tests.py'].concat(rest), function () {
      if (tryToRun('python3', ['--version']).match(Failure(_, _))) {

        // fix for https://github.com/back2dos/travix/issues/83
        if (Sys.systemName() == 'Mac' && tryToRun('python', ['--version']).match(Success(_))) {
          // https://stackoverflow.com/questions/49672642/trying-to-install-python3-using-brew
          exec('brew', ['upgrade', "python"]);
        } else {
          installPackage('python3');
        }
      }
      exec('python3', ['bin/python/tests.py']);
    });
  }
}

Fix installation of Python 3 on OSX via brew
Fix installation of Python 3 on OSX via brew
back2dos/travix,back2dos/travix,back2dos/travix