diff --git a/chezmoi/private_dot_config/opencode/create_opencode.json b/chezmoi/.chezmoitemplates/opencode.json similarity index 100% rename from chezmoi/private_dot_config/opencode/create_opencode.json rename to chezmoi/.chezmoitemplates/opencode.json diff --git a/chezmoi/private_dot_config/opencode/create_tui.json b/chezmoi/.chezmoitemplates/tui.json similarity index 100% rename from chezmoi/private_dot_config/opencode/create_tui.json rename to chezmoi/.chezmoitemplates/tui.json diff --git a/chezmoi/private_dot_claude/modify_CLAUDE.md b/chezmoi/private_dot_claude/modify_CLAUDE.md index 014510e0..8010345e 100644 --- a/chezmoi/private_dot_claude/modify_CLAUDE.md +++ b/chezmoi/private_dot_claude/modify_CLAUDE.md @@ -1,13 +1,13 @@ {{- /*chezmoi:modify-template*/ -}} -{{- $currentContent := .chezmoi.stdin -}} -{{- $marker := "" -}} +{{- $current := .chezmoi.stdin -}} +{{- $marker := "" -}} {{- printf "%s\n" "@AGENTS.md" -}} {{- printf "%s\n" $marker -}} {{- /*Extract and append only the plugin modifications */ -}} -{{- if contains $marker $currentContent -}} +{{- if contains $marker $current -}} {{- /* Split the file by the marker and grab everything after it*/ -}} -{{- $splitContent := splitList $marker $currentContent -}} +{{- $splitContent := splitList $marker $current -}} {{- printf "%s" (index $splitContent 1 | trim) -}} {{- end -}} diff --git a/chezmoi/private_dot_config/opencode/modify_AGENTS.md b/chezmoi/private_dot_config/opencode/modify_AGENTS.md index 9e9b0a9f..ccd591ca 100644 --- a/chezmoi/private_dot_config/opencode/modify_AGENTS.md +++ b/chezmoi/private_dot_config/opencode/modify_AGENTS.md @@ -1,13 +1,13 @@ {{- /*chezmoi:modify-template*/ -}} -{{- $currentContent := .chezmoi.stdin -}} -{{- $marker := "" -}} +{{- $current := .chezmoi.stdin -}} +{{- $marker := "" -}} {{- printf "%s\n" (includeTemplate "AGENTS.md") -}} {{- printf "%s\n" $marker -}} {{- /*Extract and append only the plugin modifications*/ -}} -{{- if contains $marker $currentContent -}} +{{- if contains $marker $current -}} {{- /*Split the file by the marker and grab everything after it*/ -}} -{{- $splitContent := splitList $marker $currentContent -}} +{{- $splitContent := splitList $marker $current -}} {{- printf "%s" (index $splitContent 1 | trim) -}} {{- end -}} diff --git a/chezmoi/private_dot_config/opencode/modify_opencode.json b/chezmoi/private_dot_config/opencode/modify_opencode.json new file mode 100644 index 00000000..d02160a8 --- /dev/null +++ b/chezmoi/private_dot_config/opencode/modify_opencode.json @@ -0,0 +1,7 @@ +{{- /* chezmoi:modify-template */ -}} +{{- $current := dict -}} +{{- if .chezmoi.stdin | trim -}} +{{- $current = fromJson .chezmoi.stdin -}} +{{- end -}} +{{- $chezmoi := includeTemplate "opencode.json" . | fromJson -}} +{{ mergeOverwrite $current $chezmoi | toPrettyJson }} diff --git a/chezmoi/private_dot_config/opencode/modify_tui.json b/chezmoi/private_dot_config/opencode/modify_tui.json new file mode 100644 index 00000000..b648f433 --- /dev/null +++ b/chezmoi/private_dot_config/opencode/modify_tui.json @@ -0,0 +1,7 @@ +{{- /* chezmoi:modify-template */ -}} +{{- $current := dict -}} +{{- if .chezmoi.stdin | trim -}} +{{- $current = fromJson .chezmoi.stdin -}} +{{- end -}} +{{- $chezmoi := includeTemplate "tui.json" . | fromJson -}} +{{ mergeOverwrite $current $chezmoi | toPrettyJson }}