From def3fca37ecc1c0d4f68c8e6a873b27770e0189e Mon Sep 17 00:00:00 2001 From: Ishant5436 Date: Tue, 9 Jun 2026 19:55:17 +0530 Subject: [PATCH 1/2] fix `--directory` absolute path resolution in powersync pull instance (fixes #55) --- cli/src/commands/pull/instance.ts | 2 +- packages/cli-core/src/command-types/PowerSyncCommand.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/commands/pull/instance.ts b/cli/src/commands/pull/instance.ts index 9041ee6..0b3fca7 100644 --- a/cli/src/commands/pull/instance.ts +++ b/cli/src/commands/pull/instance.ts @@ -112,7 +112,7 @@ export default class PullInstance extends CloudInstanceCommand { orgId: resolvedLink.org_id, projectId: resolvedLink.project_id }); - this.log(`Created ${ux.colorize('blue', `${directory}/${CLI_FILENAME}`)} with Cloud instance link.`); + this.log(`Created ${ux.colorize('blue', join(projectDir, CLI_FILENAME))} with Cloud instance link.`); } const { linked } = await this.loadProject(flags); diff --git a/packages/cli-core/src/command-types/PowerSyncCommand.ts b/packages/cli-core/src/command-types/PowerSyncCommand.ts index 3685903..62825bf 100644 --- a/packages/cli-core/src/command-types/PowerSyncCommand.ts +++ b/packages/cli-core/src/command-types/PowerSyncCommand.ts @@ -1,6 +1,6 @@ import { JourneyError } from '@journeyapps-labs/micro-errors'; import { Command, ux } from '@oclif/core'; -import { join } from 'node:path'; +import { resolve } from 'node:path'; import { formatPowersyncServiceErrorDisplay, @@ -26,7 +26,7 @@ export abstract class PowerSyncCommand extends Command { /** Resolves the project directory path from the --directory flag (relative to cwd). */ resolveProjectDir(flags: { directory: string }): string { - return join(process.cwd(), flags.directory); + return resolve(process.cwd(), flags.directory); } /** From 8e91e70ed0412e123e739ff9ad6f7d2f164f954d Mon Sep 17 00:00:00 2001 From: Ishant5436 Date: Tue, 9 Jun 2026 20:15:09 +0530 Subject: [PATCH 2/2] chore: add changeset for directory path fix --- .changeset/fix-directory-path.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/fix-directory-path.md diff --git a/.changeset/fix-directory-path.md b/.changeset/fix-directory-path.md new file mode 100644 index 0000000..f47cb18 --- /dev/null +++ b/.changeset/fix-directory-path.md @@ -0,0 +1,6 @@ +--- +'@powersync/cli-core': patch +'powersync': patch +--- + +fix `--directory` absolute path resolution in CLI