Skip to content

Commit

Permalink
feat: log the commit hash when init Eko (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
HairlessVillager authored Feb 28, 2025
1 parent 016d827 commit 319b206
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
34 changes: 29 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import copy from 'rollup-plugin-copy';
import replace from '@rollup/plugin-replace';
import { execSync } from 'child_process';

const commitHash = execSync('git rev-parse HEAD').toString().trim();

export default [
{
Expand All @@ -27,7 +30,10 @@ export default [
declarationDir: 'dist',
include: ['src/**/*'],
exclude: ['node_modules', 'dist', 'src/extension/**/*', 'src/web/**/*', 'src/nodejs/**/*', 'src/fellou/**/*']
})
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
]
},
{
Expand All @@ -52,6 +58,9 @@ export default [
include: ['src/common/**/*', 'src/types/*', 'src/extension/**/*'],
exclude: ['src/extension/script']
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
copy({
targets: [
{ src: 'src/extension/script', dest: 'dist/extension' }
Expand All @@ -73,7 +82,10 @@ export default [
declaration: false,
include: ['src/common/**/*', 'src/extension/content/*'],
declarationDir: 'dist'
})
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
]
},
{
Expand All @@ -96,7 +108,10 @@ export default [
declaration: true,
declarationDir: 'dist',
include: ['src/common/**/*', 'src/types/*', 'src/web/**/*']
})
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
]
},
{
Expand All @@ -116,7 +131,10 @@ export default [
declaration: true,
declarationDir: 'dist',
include: ['src/common/**/*', 'src/types/*', 'src/nodejs/**/*']
})
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
]
},
{
Expand All @@ -137,6 +155,9 @@ export default [
declarationDir: 'dist',
include: ['src/common/**/*', 'src/types/*', 'src/nodejs/**/*']
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
replace({
preventAssignment: true,
values: {
Expand Down Expand Up @@ -165,7 +186,10 @@ export default [
declaration: true,
declarationDir: 'dist',
include: ['src/common/**/*', 'src/types/*', 'src/fellou/**/*']
})
}),
replace({
'process.env.COMMIT_HASH': JSON.stringify(commitHash),
}),
]
}
];
1 change: 1 addition & 0 deletions src/core/eko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class Eko {
private workflowGeneratorMap = new Map<Workflow, WorkflowGenerator>();

constructor(llmConfig: LLMConfig, ekoConfig?: EkoConfig) {
console.info("using Eko@" + process.env.COMMIT_HASH);
this.llmProvider = LLMProviderFactory.buildLLMProvider(llmConfig);

if (ekoConfig) {
Expand Down

0 comments on commit 319b206

Please sign in to comment.