Skip to content

Commit 64cd6f3

Browse files
committed
fix(cli): path pattern relativity
1 parent 18ebf86 commit 64cd6f3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.changeset/few-socks-swim.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@replexica/cli": patch
3+
"replexica": patch
4+
---
5+
6+
fixed path patter relativity

packages/cli/src/workers/bucket/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ import { ReplexicaCLIError } from '../../utils/errors';
2020
import { csvLoader } from './csv';
2121

2222
// Path expansion
23-
export function expandPlaceholderedGlob(pathPattern: string, sourceLocale: string): string[] {
23+
export function expandPlaceholderedGlob(_pathPattern: string, sourceLocale: string): string[] {
2424
// Throw if pathPattern is an absolute path
25-
if (path.isAbsolute(pathPattern)) {
26-
throw new ReplexicaCLIError({
27-
message: `Invalid path pattern: ${pathPattern}. Path pattern must be relative.`,
28-
docUrl: 'invalidPathPattern'
29-
});
30-
}
25+
const absolutePathPattern = path.resolve(_pathPattern);
26+
const pathPattern = path.relative(process.cwd(), absolutePathPattern);
3127
// Throw if pathPattern points outside the current working directory
3228
if (path.relative(process.cwd(), pathPattern).startsWith('..')) {
3329
throw new ReplexicaCLIError({

0 commit comments

Comments
 (0)