lauf init
Initialize lauf in the current directory by creating a lauf.config.ts file.
Usage
bash
lauf initBehavior
- Checks if a config already exists by searching upward from the current directory
- If a config is found, exits with an error ("Already initialized")
- If no config exists, writes a new
lauf.config.tsin the current directory
The generated config file contains:
ts
import { defineConfig } from 'laufen';
export default defineConfig({
scripts: ['scripts/*.ts'],
});Error Cases
| Scenario | Message |
|---|---|
| Config found in a parent directory | Already initialized: config found at <path> |
lauf.config.ts already exists | Already initialized: lauf.config.ts already exists |
| Write failure | Failed to write lauf.config.ts: <error> |
Notes
- Existing config files will not be overwritten
- The upward search finds both
lauf.config.tsandlaufen.config.tsin any ancestor directory