Skip to content

Commit 71d022d

Browse files
committed
feat(builtins): add user_name placeholder to static placeholders
1 parent 8edf231 commit 71d022d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shared/prompts/replacement/builtins.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { existsSync } from 'node:fs';
77
import { readFile } from 'node:fs/promises';
8+
import * as os from 'node:os';
89
import * as path from 'node:path';
910

1011
const CM_FOLDER = '.codemachine';
@@ -15,6 +16,7 @@ const STATIC_PLACEHOLDERS: Record<string, () => string> = {
1516
date: () => new Date().toISOString().split('T')[0], // YYYY-MM-DD
1617
datetime: () => new Date().toISOString(),
1718
timestamp: () => Date.now().toString(),
19+
user_name: () => os.userInfo().username,
1820
};
1921

2022
// Context-dependent placeholders (loaded from template.json)

0 commit comments

Comments
 (0)