Skip to content

Commit

Permalink
Merge pull request #35 from Dzuelu/cliGenSearchPlaces
Browse files Browse the repository at this point in the history
Use cli generateSearchPlaces to find config
  • Loading branch information
capaj authored Nov 29, 2023
2 parents 34f2cb5 + 730d6f5 commit 91b9764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
7 changes: 5 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import cloneDeep from 'lodash.clonedeep'
import { YamlCliFlags } from '@graphql-codegen/cli'

import globby from 'globby'
import { generateSearchPlaces } from './generateSearchPlaces'

/**
* Current workspace directory
Expand Down Expand Up @@ -105,7 +104,11 @@ const getConfigPath = async () => {
return makePathAbsolute(userConfigPath)
}

const foundConfigs = await globby(generateSearchPlaces('codegen'), {
if (cli == null) {
return; // cli should already be loaded here
}

const foundConfigs = await globby(cli.generateSearchPlaces('codegen'), {
cwd: firstWorkspaceDirectory()
})

Expand Down
12 changes: 0 additions & 12 deletions src/generateSearchPlaces.ts

This file was deleted.

0 comments on commit 91b9764

Please sign in to comment.