Add exists command

This commit is contained in:
2026-10-07 17:41:45 -05:00
parent 976f833536
commit d1c2d4f4b8
3 changed files with 59 additions and 0 deletions

View File

@@ -446,6 +446,12 @@ Assuming the current subject is a valid single data document, convert it `from`
Supports: `php`|`json`
Example: `{"a": 1}` -> `convert json php` -> `['a' => 1]`
#### `exists <fs|var> <name>`
Checks whether the given file or variable exists.
Supports: `fs` for filesystem checks, `var` for variable names
Example: `$a = 1` -> `exists var a` -> `1`
Example: `exists fs fake-file.txt` -> `0`
#### User-specific setup files
The file `~/.str.rc` is automatically executed when `str` starts up.
You can use this to define a user-specific environment.