taskmonkey-cli 0.10.0 → 0.10.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskmonkey-cli",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "TaskMonkey CLI — Remote dev tools for tenant config editing and tool testing",
5
5
  "bin": {
6
6
  "tm": "./bin/tm.js",
@@ -36,17 +36,21 @@ export async function pull() {
36
36
  written++;
37
37
  }
38
38
 
39
- // Write docs if available
39
+ // Write docs if available. The server returns relative paths that may
40
+ // contain subdirectories (e.g. cms/contao.md), so we need to mkdir -p
41
+ // the dirname of each full target path, not just the top-level folder.
40
42
  if (docs?.files) {
41
43
  for (const [name, content] of Object.entries(docs.files)) {
42
- // shared/ files go to shared/, docs go to docs/
43
- const targetDir = name.startsWith('shared/')
44
+ // shared/ files go to shared/, everything else to docs/
45
+ const isShared = name.startsWith('shared/');
46
+ const baseDir = isShared
44
47
  ? join(config._configDir, 'shared')
45
48
  : join(config._configDir, 'docs');
46
- const fileName = name.startsWith('shared/') ? name.substring(7) : name;
47
- mkdirSync(targetDir, { recursive: true });
48
- writeFileSync(join(targetDir, fileName), content);
49
- console.log(chalk.gray(` ${name.startsWith('shared/') ? 'shared' : 'docs'}/${fileName}`));
49
+ const relName = isShared ? name.substring(7) : name;
50
+ const fullPath = join(baseDir, relName);
51
+ mkdirSync(dirname(fullPath), { recursive: true });
52
+ writeFileSync(fullPath, content);
53
+ console.log(chalk.gray(` ${isShared ? 'shared' : 'docs'}/${relName}`));
50
54
  written++;
51
55
  }
52
56
  }