# \_travis\_terminate\_MacOSX: command not found

**URL:** https://travis-ci.community/t/travis-terminate-macosx-command-not-found/9846
**Category:** Deployment
**Created:** [September 7, 2020, 6:08pm UTC](https://travis-ci.community/t/travis-terminate-macosx-command-not-found/9846 "2020-09-07T18:08:40Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)
#### Post date: [September 8, 2020, 4:00am UTC](https://travis-ci.community/t/travis-terminate-macosx-command-not-found/9846/2 "2020-09-08T04:00:10Z")

</div>

Hey @marimeireles,

Couple examples how `travis_terminate` can be used, for example in a `.travis.yml` file I was making the other day it looked liked this:

```bash
travis_assert() {
  local result=${1:-$?}
  if [$result -ne 0]; then
    echo -e "\n${ANSI_RED}The command \"$TRAVIS_CMD\" failed and exited with $result during $TRAVIS_STAGE.${ANSI_RESET}\n\nYour build has been stopped."
    travis_terminate 2
  fi
}

```

Another example would be:

```bash
travis_terminate() {
  set +e

```

Both of these resulted in non-issue. From briefly looking at your `.travis.yml` I don’t see anything wrong with it. I suggest you take a look at the following:

> <https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_terminate.bash>

This will give you a better idea of the function of `travis_terminate`, and also I would suggest checking out this response by **native-api,** - and see with this information we can’t curb this issue!

> [@Travis\_terminate command not found](https://travis-ci.community/t/travis-terminate-command-not-found/4383):
>
> I am running a Python script during the before\_deploy stage to determine the presence of a file. If that file is not found, I am trying to use the [poorly-documented](https://github.com/travis-ci/docs-travis-ci-com/issues/1899) travis\_terminate command to halt the process: run\_process(["travis\_terminate", "0"]) This seems to be a common approach, as mentioned in [#1574](https://github.com/travis-ci/travis-ci/issues/1574) and other issues. However, this invocation results in a FileNotFoundError: FileNotFoundError: [Errno 2] No such file or directory: 'travis\_terminate': 'travis\_terminate' At first, I though…

I hope this helps, if none of this helps please post back and I’ll investigate further.

-Montana  
(Travis CI Staff)

---

_[View the full topic](https://travis-ci.community/t/travis-terminate-macosx-command-not-found/9846)._
