claude-init 1.0.32 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +25 -5
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -101,8 +101,8 @@ export async function cli() {
|
|
|
101
101
|
'js'
|
|
102
102
|
);
|
|
103
103
|
|
|
104
|
-
// Map devcontainer variant to directory name
|
|
105
|
-
const
|
|
104
|
+
// Map devcontainer variant to source directory name in templates
|
|
105
|
+
const devcontainerSourceMap = {
|
|
106
106
|
'js': '.devcontainer',
|
|
107
107
|
'go': '.devcontainer-go',
|
|
108
108
|
'rust': '.devcontainer-rust'
|
|
@@ -128,10 +128,30 @@ export async function cli() {
|
|
|
128
128
|
|
|
129
129
|
// Conditionally add devcontainer task
|
|
130
130
|
if (devcontainerVariant !== 'none') {
|
|
131
|
-
const
|
|
131
|
+
const sourceDir = devcontainerSourceMap[devcontainerVariant];
|
|
132
132
|
tasks.splice(1, 0, {
|
|
133
|
-
name:
|
|
134
|
-
handler: () =>
|
|
133
|
+
name: '.devcontainer',
|
|
134
|
+
handler: async () => {
|
|
135
|
+
const targetPath = path.join(targetDir, '.devcontainer');
|
|
136
|
+
const templatePath = path.join(getTemplatesPath(), sourceDir);
|
|
137
|
+
|
|
138
|
+
const exists = await fs.pathExists(targetPath);
|
|
139
|
+
|
|
140
|
+
// Remove existing .devcontainer if it exists
|
|
141
|
+
if (exists) {
|
|
142
|
+
await fs.remove(targetPath);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Copy from selected source to .devcontainer
|
|
146
|
+
await fs.copy(templatePath, targetPath);
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
action: exists ? 'updated' : 'created',
|
|
150
|
+
details: exists
|
|
151
|
+
? `Overwrote .devcontainer with ${devcontainerVariant} configuration`
|
|
152
|
+
: `Created .devcontainer with ${devcontainerVariant} configuration`
|
|
153
|
+
};
|
|
154
|
+
}
|
|
135
155
|
});
|
|
136
156
|
}
|
|
137
157
|
|