Skip to content

Commit

Permalink
cancel docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Mar 28, 2024
1 parent 53ad0aa commit fef0e2c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/src/content/docs/reference/scripts/cancel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Cancel
siderbar:
order: 15
---

It is not uncommon that upon executing a script, you may want to cancel the execution of the script. This can be done using the `cancel` function. The `cancel` function takes an optional `reason` argument and will immediately stop the execution of the script.

```js
if (!env.files.length)
cancel("Nothing to do")
```

0 comments on commit fef0e2c

Please sign in to comment.