> ## Documentation Index
> Fetch the complete documentation index at: https://errand.nuvrel.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# abspath

> Convert a path to an absolute path.

`abspath(path)` converts `path` to an absolute path. Relative paths are resolved from the playbook's working directory.

## Signature

```
abspath(path string) string
```

## Example

Ensure that a volume mount path in a Docker run command is always absolute, regardless of where `errand` is invoked from:

```hcl theme={null}
variable "data_dir" {
  description = "Path to the data directory to mount"
  type        = string
  default     = "./data"
}

computed "data_abs" {
  description = "Absolute path to the data directory"
  expression  = abspath(var.data_dir)
}

task "run-db" {
  description = "Start the database with a local volume"
  commands    = ["docker run -v ${computed.data_abs}:/var/lib/postgresql/data postgres:16"]
}
```

`./data` becomes something like `/home/user/project/data`, which is required by `docker run`.

## Notes

* `abspath` resolves the path relative to the effective working directory at evaluation time.
* If `path` is already absolute, it is returned cleaned but otherwise unchanged.
