Skip to content

Commit 2945da4

Browse files
committed
feat(config): update default worktree subdirectory template (#38)
Change the default value of worktreeSubdirectoryTemplate from 'worktree$INDEX' to '$BASE_NAME$INDEX' to provide more meaningful default names for worktree directories. This affects both the package.json configuration and the TypeScript config handling.
1 parent 2744186 commit 2945da4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@
948948
"git-worktree-manager.worktreeSubdirectoryTemplate": {
949949
"order": 12,
950950
"type": "string",
951-
"default": "worktree$INDEX",
951+
"default": "$BASE_NAME$INDEX",
952952
"pattern": "^[^/\\\\:*?\"<>|]+$",
953953
"patternErrorMessage": "%config.worktreeSubdirectoryTemplate.patternErrorMessage%",
954954
"description": "%config.worktreeSubdirectoryTemplate.description%"

src/core/config/setting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class Config {
6767

6868
// Path template configuration
6969
static get(key: 'worktreePathTemplate', defaultValue: '$BASE_PATH.worktree'): string;
70-
static get(key: 'worktreeSubdirectoryTemplate', defaultValue: 'worktree$INDEX'): string;
70+
static get(key: 'worktreeSubdirectoryTemplate', defaultValue: '$BASE_NAME$INDEX'): string;
7171

7272
// Post-creation command configuration
7373
static get(key: 'postCreateCmd', defaultValue: ''): string;

src/core/util/folder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const validateSubdirectoryTemplate = (template: string): boolean => {
5454

5555
// get worktree subdirectory name with baseName and index
5656
export const getSubDir = (baseName: string, index: string | number) => {
57-
const template = Config.get('worktreeSubdirectoryTemplate', 'worktree$INDEX');
57+
const template = Config.get('worktreeSubdirectoryTemplate', '$BASE_NAME$INDEX');
5858

5959
// Validate template
6060
if (!validateSubdirectoryTemplate(template)) {

0 commit comments

Comments
 (0)