mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 00:55:16 -07:00
feat(launcher): add --version / -v flag to print app version
- Exits early with `SubMiner <version>` output, no app binary required - Maps `-v` at root level without conflicting with `stats cleanup -v` - Adds `version: boolean` to `Args` type and default args - Documents flag in docs-site and adds changelog fragment
This commit is contained in:
@@ -99,6 +99,30 @@ test('config discovery ignores lowercase subminer candidate', () => {
|
||||
assert.equal(resolved, expected);
|
||||
});
|
||||
|
||||
test('version flag prints installed app version without requiring app binary', () => {
|
||||
withTempDir((root) => {
|
||||
const homeDir = path.join(root, 'home');
|
||||
const xdgConfigHome = path.join(root, 'xdg');
|
||||
const result = runLauncher(['--version'], makeTestEnv(homeDir, xdgConfigHome));
|
||||
|
||||
assert.equal(result.status, 0);
|
||||
assert.match(result.stdout.trim(), /^SubMiner \d+\.\d+\.\d+/);
|
||||
assert.equal(result.stderr, '');
|
||||
});
|
||||
});
|
||||
|
||||
test('short version flag prints installed app version without requiring app binary', () => {
|
||||
withTempDir((root) => {
|
||||
const homeDir = path.join(root, 'home');
|
||||
const xdgConfigHome = path.join(root, 'xdg');
|
||||
const result = runLauncher(['-v'], makeTestEnv(homeDir, xdgConfigHome));
|
||||
|
||||
assert.equal(result.status, 0);
|
||||
assert.match(result.stdout.trim(), /^SubMiner \d+\.\d+\.\d+/);
|
||||
assert.equal(result.stderr, '');
|
||||
});
|
||||
});
|
||||
|
||||
test('config path prefers jsonc over json for same directory', () => {
|
||||
withTempDir((root) => {
|
||||
const homeDir = path.join(root, 'home');
|
||||
|
||||
Reference in New Issue
Block a user