summaryrefslogtreecommitdiff
path: root/source/features/create-release-shortcut.tsx
blob: 66d63cd16fde514795366a63a7a267c45f4d0032 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as pageDetect from 'github-url-detection';

import features from '../feature-manager.js';
import {registerHotkey} from '../github-helpers/hotkey.js';
import {buildRepoURL} from '../github-helpers/index.js';

function init(signal: AbortSignal): void {
	// Reasoning for this feature: #1254
	registerHotkey('c', buildRepoURL('releases/new'), {signal});
}

void features.add(import.meta.url, {
	shortcuts: {
		c: 'Create a new release',
	},
	include: [
		pageDetect.isReleasesOrTags,
	],
	exclude: [
		pageDetect.isNewRelease,
		pageDetect.isEditingRelease,
	],
	init,
});

/*

Test URLs

https://github.com/refined-github/refined-github/releases
https://github.com/refined-github/sandbox/releases/new
https://github.com/refined-github/sandbox/releases/tag/cool

*/