Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/fix-directory-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@powersync/cli-core': patch
'powersync': patch
---

fix `--directory` absolute path resolution in CLI
2 changes: 1 addition & 1 deletion cli/src/commands/pull/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-core/src/command-types/PowerSyncCommand.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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);
}

/**
Expand Down