Skip to content

Commit 38b2414

Browse files
committed
Moved login init to base command. Fixes
1 parent 5630319 commit 38b2414

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/api/dashboard/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const DashboardApiClient = {
1111
}
1212

1313
const res = await fetch(
14-
`${API_BASE_URL}/api/documents/${id}`,
14+
`${API_BASE_URL}/api/v1/documents/${id}`,
1515
{ method: 'GET', headers: { 'Content-Type': 'application/json', 'authorization': login.accessToken } },
1616
);
1717

src/commands/import.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For more information, visit: https://docs.codifycli.com/commands/import`
5252
this.log(`Applying Codify from: ${flags.path}`);
5353
}
5454

55-
const resolvedPath = path.resolve(flags.path ?? '.');
55+
const resolvedPath = flags.path ?? '.';
5656

5757
const args = raw
5858
.filter((r) => r.type === 'arg')

src/common/base-command.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import chalk from 'chalk';
44
import { PressKeyToContinueRequestData, SudoRequestData } from 'codify-schemas';
55
import createDebug from 'debug';
66

7+
import { LoginHelper } from '../connect/login-helper.js';
78
import { Event, ctx } from '../events/context.js';
89
import { Reporter, ReporterFactory, ReporterType } from '../ui/reporters/reporter.js';
910
import { SudoUtils } from '../utils/sudo.js';
@@ -63,6 +64,8 @@ export abstract class BaseCommand extends Command {
6364
await this.reporter.promptPressKeyToContinue(data.promptMessage)
6465
ctx.pressKeyToContinueCompleted(pluginName)
6566
})
67+
68+
await LoginHelper.load();
6669
}
6770

6871
protected async catch(err: Error): Promise<void> {

src/orchestrators/plan.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export class PlanOrchestrator {
2424
static async run(args: PlanArgs, reporter: Reporter): Promise<PlanOrchestratorResponse> {
2525
ctx.processStarted(ProcessName.PLAN);
2626

27-
await LoginHelper.load();
28-
2927
const initializationResult = await PluginInitOrchestrator.run({
3028
...args,
3129
}, reporter);

0 commit comments

Comments
 (0)