Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dotandev/envcheck/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Thefiles section validates the existence of required files and directories, optionally checking file permissions. This ensures critical project files are present before running your application.
Configuration
Each file check is defined by aFileCheck struct (src/config.rs:40) with the following fields:
The file or directory path to check. Can be absolute or relative to the current directory.
Whether the file or directory must exist. If
true, validation fails when the path is not found.Whether the path should be a directory. If
true, validation fails if the path exists but is not a directory.Unix file permissions in octal format (e.g.,
0o755, 0o644). If specified, the file must have exactly these permissions.Examples
Basic File Check
Check that a file exists:Optional Files
Mark files as optional when they’re not always needed:Directory Validation
Check that directories exist:Permission Checks
Validate file permissions (useful for scripts and executables):Permissions are specified in octal format. Common values:
755: Executable files (rwxr-xr-x)644: Regular files (rw-r—r—)600: Private files (rw-------)700: Private executables (rwx------)
Real-World Examples
Common Use Cases
Configuration Files
Project Structure
Executable Scripts
Language-Specific Files
- Node.js
- Python
- Rust
- Go
Path Resolution
Paths can be specified as:-
Relative paths: Resolved from the current working directory
-
Absolute paths: Used as-is
-
Home directory: Use
~for home directory expansion
Default Behavior
From the struct definition in src/config.rs:40:path: Required field, no defaultrequired: Defaults totrueis_directory: Defaults tofalsepermissions: Defaults toNone(no permission check)
