Skip to content

Commit

Permalink
fix: when detecting runtime in the CLI favor Go over nodejs (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj authored Jul 15, 2024
1 parent 5b31beb commit 09fd966
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions genkit-tools/common/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ export function getEntryPoint(directory: string): string | undefined {
* @returns Runtime of the project directory.
*/
export function detectRuntime(directory: string): Runtime {
if (fs.existsSync(path.join(directory, 'package.json'))) {
return 'nodejs';
}
const files = fs.readdirSync(directory);
for (const file of files) {
const filePath = path.join(directory, file);
Expand All @@ -68,5 +65,8 @@ export function detectRuntime(directory: string): Runtime {
return 'go';
}
}
if (fs.existsSync(path.join(directory, 'package.json'))) {
return 'nodejs';
}
return undefined;
}

0 comments on commit 09fd966

Please sign in to comment.