alamion_obsidian-jira-sync/check-version.js
Alamoin 0786db1535
Feats
- `Super Simple Time Tracker` plugin format support
- Support of multiple Jira connections.
- `AGENTS.md` file from Obidian plugin template and filled with info about project
- Updated eslint configs to `eslint.config.js` format + linted all the code; added prettier with according config
- localization validator improvement; multiple localization fixes
- many minor fixes
2026-04-29 17:41:24 +03:00

44 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env node
const { execSync } = require('child_process');
const stagedFiles = execSync('git diff --cached --name-only', {
encoding: 'utf-8',
})
.trim()
.split('\n')
.filter(Boolean);
const hasCodeChanges = stagedFiles.some((file) => file.endsWith('.ts') || file.endsWith('.tsx'));
const manifestChanged = stagedFiles.includes('manifest.json');
if (hasCodeChanges && !manifestChanged) {
console.error('\x1b[33m⚠ You have changed the code but have not updated manifest.json.\x1b[0m');
console.error('\x1b[33m Have you forgotten to update the plugin version?\x1b[0m');
console.error('');
console.error('If you are sure that the version does not need to be changed, use:');
console.error(' git commit --no-verify');
console.error('');
process.exit(1);
}
if (manifestChanged && hasCodeChanges) {
try {
const manifestDiff = execSync('git diff --cached manifest.json', {
encoding: 'utf-8',
});
if (!manifestDiff.includes('"version"')) {
console.error('\x1b[33m⚠ manifest.json has been modified, but the version has not been updated!\x1b[0m');
console.error('');
console.error('If this is intentional, use:');
console.error(' git commit --no-verify');
console.error('');
process.exit(1);
}
} catch (error) {}
}
console.log('\x1b[32m✓ Version check passed\x1b[0m');
process.exit(0);