2024-10-26 23:55:22 +00:00

45 lines
1.4 KiB
Diff

--- a/lib/util/utils.ts
+++ b/lib/util/utils.ts
@@ -46,34 +46,10 @@
}
async function getZigbee2MQTTVersion(includeCommitHash = true): Promise<{commitHash?: string; version: string}> {
- const git = await import('git-last-commit');
+ // XXX-Patched: removed git part
const packageJSON = await import('../..' + '/package.json');
- if (!includeCommitHash) {
- return {version: packageJSON.version, commitHash: undefined};
- }
-
- return await new Promise((resolve) => {
- const version = packageJSON.version;
-
- git.getLastCommit((err: Error, commit: {shortHash: string}) => {
- let commitHash = undefined;
-
- if (err) {
- try {
- commitHash = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', '.hash'), 'utf-8');
- } catch {
- /* istanbul ignore next */
- commitHash = 'unknown';
- }
- } else {
- commitHash = commit.shortHash;
- }
-
- commitHash = commitHash.trim();
- resolve({commitHash, version});
- });
- });
+ return {version: packageJSON.version, commitHash: undefined};
}
async function getDependencyVersion(depend: string): Promise<{version: string}> {
--- a/test/utils.test.js
+++ b/test/utils.test.js
@@ -11 +11 @@
- it('git last commit', async () => {
+ it.skip('git last commit', async () => {