Skip to content

Commit

Permalink
Adding a commit hash to the console of the UI to make debugging easier
Browse files Browse the repository at this point in the history
  • Loading branch information
codyrancher committed Oct 2, 2023
1 parent 7a0117f commit f002ba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions web/pkg/opni/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import store from './store';

// Init the package
export default function(plugin: IPlugin, context: any) {
console.log(`%cThe UI is currently at this commit: ${ process.env.commitHash }`, 'color: #a453b9;');

// Auto-import model, detail, edit from the folders
importTypes(plugin);

Expand Down
6 changes: 5 additions & 1 deletion web/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ baseConfig.devServer.proxy = {

baseConfig.configureWebpack = (config) => {
config.cache = { type: 'filesystem' };
const comitHash = require('child_process').execSync('git rev-parse HEAD').toString().trim();

config.plugins.push(new webpack.DefinePlugin({ 'process.env.isStandalone': JSON.stringify(isStandalone) }));
config.plugins.push(new webpack.DefinePlugin({
'process.env.isStandalone': JSON.stringify(isStandalone),
'process.env.commitHash': JSON.stringify(comitHash)
}));

baseConfigureWebpack(config);
};
Expand Down

0 comments on commit f002ba5

Please sign in to comment.