@tolgee/cli 2.3.2 → 2.3.4

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.
@@ -1,14 +1,14 @@
1
1
  import { extname, join } from 'path';
2
2
  import { readdir, readFile, stat } from 'fs/promises';
3
3
  import { Command, Option } from 'commander';
4
- import { glob } from 'glob';
5
4
  import { loading, success, error, warn, exitWithError, } from '../utils/logger.js';
6
5
  import { askString } from '../utils/ask.js';
7
6
  import { mapImportFormat } from '../utils/mapImportFormat.js';
8
7
  import { handleLoadableError } from '../client/TolgeeClient.js';
8
+ import { windowsCompatibleGlob } from '../utils/windowsCompatibleGlob.js';
9
9
  async function allInPattern(pattern) {
10
10
  const files = [];
11
- const items = await glob(pattern);
11
+ const items = await windowsCompatibleGlob(pattern);
12
12
  for (const item of items) {
13
13
  if ((await stat(item)).isDirectory()) {
14
14
  files.push(...(await readDirectory(item)));
@@ -44,6 +44,7 @@ function parseConfig(input, configDir) {
44
44
  path: resolve(configDir, r.path),
45
45
  }));
46
46
  }
47
+ // convert relative paths in config to absolute
47
48
  if (rc.pull?.path !== undefined) {
48
49
  rc.pull.path = resolve(configDir, rc.pull.path);
49
50
  }
@@ -1,7 +1,7 @@
1
- import { glob } from 'glob';
2
1
  import { extname } from 'path';
3
2
  import { callWorker } from './worker.js';
4
3
  import { exitWithError } from '../utils/logger.js';
4
+ import { windowsCompatibleGlob } from '../utils/windowsCompatibleGlob.js';
5
5
  export const NullNamespace = Symbol('namespace.null');
6
6
  function parseVerbose(v) {
7
7
  return Array.isArray(v) ? v : v ? [] : undefined;
@@ -54,7 +54,9 @@ export async function extractKeysOfFiles(opts) {
54
54
  if (!opts.patterns?.length) {
55
55
  exitWithError("Missing '--patterns' or 'config.patterns' option");
56
56
  }
57
- const files = await glob(opts.patterns, { nodir: true });
57
+ const files = await windowsCompatibleGlob(opts.patterns, {
58
+ nodir: true,
59
+ });
58
60
  if (files.length === 0) {
59
61
  exitWithError('No files were matched for extraction');
60
62
  }
@@ -0,0 +1,7 @@
1
+ import { glob } from 'glob';
2
+ export const windowsCompatibleGlob = (pattern, options) => {
3
+ return glob(pattern, {
4
+ ...options,
5
+ windowsPathsNoEscape: process.platform === 'win32',
6
+ });
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolgee/cli",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "type": "module",
5
5
  "description": "A tool to interact with the Tolgee Platform through CLI",
6
6
  "repository": {