Skip to content

Commit 950c4dd

Browse files
committed
fix: Fixed existing tests
1 parent 130402a commit 950c4dd

File tree

12 files changed

+279
-321
lines changed

12 files changed

+279
-321
lines changed

src/commands/connect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ For more information, visit: https://docs.codifycli.com/commands/connect
1818

1919
public async run(): Promise<void> {
2020
const { flags } = await this.parse(Connect)
21-
const config = this.config;
21+
const rootCommand = this.config.options.root;
2222

23-
await ConnectOrchestrator.run(config, this.reporter);
23+
await ConnectOrchestrator.run(rootCommand, this.reporter);
2424
}
2525
}

src/commands/edit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ For more information, visit: https://docs.codifycli.com/commands/edit
1717

1818
public async run(): Promise<void> {
1919
const { flags } = await this.parse(Edit);
20-
const config = this.config;
20+
const rootCommand = this.config.options.root;
2121

22-
await EditOrchestrator.run(config, this.reporter);
22+
await EditOrchestrator.run(rootCommand, this.reporter);
2323

2424
}
2525
}

src/orchestrators/connect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export class ConnectOrchestrator {
1919
static rootCommand: string;
2020
static nodeBinary: string;
2121

22-
static async run(oclifConfig: Config, reporter: Reporter, openBrowser = true, onOpen?: (connectionCode: string) => void) {
22+
static async run(rootCommand: string, reporter: Reporter, openBrowser = true, onOpen?: (connectionCode: string) => void) {
2323
const login = LoginHelper.get()?.isLoggedIn;
2424
if (!login) {
2525
ctx.log('User is not logged in. Attempting to log in...')
2626
await LoginOrchestrator.run();
2727
}
2828

29-
this.rootCommand = oclifConfig.options.root;
29+
this.rootCommand = rootCommand;
3030
this.nodeBinary = process.execPath;
3131

3232
const connectionSecret = ConnectOrchestrator.tokenGenerate()

src/orchestrators/edit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { LoginOrchestrator } from './login.js';
1010

1111
export class EditOrchestrator {
1212

13-
static async run(oclifConfig: Config, reporter: Reporter) {
13+
static async run(rootCommand: string, reporter: Reporter) {
1414
const login = LoginHelper.get()?.isLoggedIn;
1515
if (!login) {
1616
console.log('User is not logged in. Attempting to log in...')
@@ -28,7 +28,7 @@ export class EditOrchestrator {
2828
? `${config.dashboardUrl}/document/${defaultDocumentId}`
2929
: config.dashboardUrl;
3030

31-
await ConnectOrchestrator.run(oclifConfig, reporter, false, (code) => {
31+
await ConnectOrchestrator.run(rootCommand, reporter, false, (code) => {
3232
open(`${url}?connection_code=${code}`);
3333
console.log(
3434
`Opening default Codify file:

src/parser/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { FileReader } from './reader/file-reader.js';
1717
import { SourceMapCache } from './source-maps.js';
1818
import { YamlParser } from './yaml/yaml-parser.js';
1919

20-
export const CODIFY_FILE_REGEX = /^(.*)?codify(.json|.yaml|.json5|.jsonc)$/;
20+
export const CODIFY_FILE_REGEX = /^(.*)?codify(.*)?(.json|.yaml|.json5|.jsonc)$/;
2121

2222
class Parser {
2323
private readonly languageSpecificParsers= {

src/parser/yaml/yaml-parser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('YamlParser tests', () => {
3232

3333
expect(result.length).to.eq(4);
3434
expect(result[0]).toMatchObject({
35-
contents: { type: 'project', plugins: { default: '../homebrew-plugin/src/router.ts' }},
35+
contents: { type: 'project', plugins: { default: '../homebrew-plugin/src/index.ts' }},
3636
})
3737

3838
})

0 commit comments

Comments
 (0)