forked from refined-github/refined-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew-feature.sh
More file actions
executable file
·43 lines (34 loc) · 1.08 KB
/
new-feature.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.08 KB
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
35
36
37
38
39
40
41
42
43
#! /bin/bash
# Automatically exit on error
set -e
if [ -z "$1" ]
then
echo "Please provide a name for the feature"
exit 1
fi
echo "import React from 'react';
import BugIcon from 'octicons-plain-react/Bug';
import * as pageDetect from 'github-url-detection';
import features from '../feature-manager.js';
import observe from '../helpers/selector-observer.js';
function applyToButton(button: HTMLButtonElement): void {
button.append(<BugIcon/>);
console.log('✨');
}
function init(signal: AbortSignal): void {
observe('button.btn', applyToButton, {signal});
}
void features.add(import.meta.url, {
include: [
pageDetect.isPR, // Find the one you need on https://refined-github.github.io/github-url-detection/
],
init,
});
" >> "source/features/$1.tsx"
echo "import './features/$1.js';" >> ./source/refined-github.ts
echo "✨ Feature created! ✨"
echo "source/features/$1.tsx"
echo
echo "After you're done, also add the feature to ./readme.md; Don't worry about the screenshot yet"
echo
echo Refer to https://github.com/refined-github/refined-github/wiki/Contributing for more information.