Skip to content

Commit e8efb10

Browse files
committed
feat: add dynamic column layout and all install option to font installer
- Updated installer script to display font options in dynamically aligned columns based on terminal width, enhancing readability and usability. - Added all option to allow users to install all available fonts at once. - Improved input validation for font selection to handle edge cases and incorrect inputs more gracefully. - Initial commit with cleaned history
0 parents  commit e8efb10

11 files changed

+589
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '...'
17+
3. Scroll down to '...'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. Linux Arch]
28+
- Kernel version [e.g. 6.10.10-arch1-1]
29+
30+
**Additional context**
31+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Bug Report
4+
url: https://github.com/fam007e/nerd_fonts_installer/issues/new?template=bug_report.md
5+
about: File a bug report for the project.
6+
- name: Feature Request
7+
url: https://github.com/fam007e/nerd_fonts_installer/issues/new?template=feature_request.md
8+
about: Suggest a new feature for the project.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex: I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Description
2+
3+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Documentation update
15+
16+
## Checklist:
17+
18+
- [ ] My code follows the style guidelines of this project
19+
- [ ] I have performed a self-review of my own code
20+
- [ ] I have commented my code, particularly in hard-to-understand areas
21+
- [ ] I have made corresponding changes to the documentation
22+
- [ ] My changes generate no new warnings
23+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/discord-webhook.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Discord Webhook Notification
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, closed, reopened]
9+
pull_request_review:
10+
types: [submitted, edited, dismissed]
11+
issues:
12+
types: [opened, closed, reopened]
13+
release:
14+
types: [published, edited, released]
15+
check_run:
16+
types: [completed]
17+
check_suite:
18+
types: [completed]
19+
deployment:
20+
types: [created, completed]
21+
22+
jobs:
23+
notify:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Send notification to Discord for Push
27+
if: github.event_name == 'push'
28+
run: |
29+
curl -H "Content-Type: application/json" \
30+
-d "{\"content\": \"New push event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
31+
${{ secrets.DISCORD_WEBHOOK_URL }}
32+
33+
- name: Send notification to Discord for Pull Request
34+
if: github.event_name == 'pull_request'
35+
run: |
36+
curl -H "Content-Type: application/json" \
37+
-d "{\"content\": \"New pull request event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
38+
${{ secrets.DISCORD_WEBHOOK_URL }}
39+
40+
- name: Send notification to Discord for Pull Request Review
41+
if: github.event_name == 'pull_request_review'
42+
run: |
43+
curl -H "Content-Type: application/json" \
44+
-d "{\"content\": \"New pull request review event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
45+
${{ secrets.DISCORD_WEBHOOK_URL }}
46+
47+
- name: Send notification to Discord for Issues
48+
if: github.event_name == 'issues'
49+
run: |
50+
curl -H "Content-Type: application/json" \
51+
-d "{\"content\": \"New issue event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
52+
${{ secrets.DISCORD_WEBHOOK_URL }}
53+
54+
- name: Send notification to Discord for Release
55+
if: github.event_name == 'release'
56+
run: |
57+
curl -H "Content-Type: application/json" \
58+
-d "{\"content\": \"New release event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
59+
${{ secrets.DISCORD_WEBHOOK_URL }}
60+
61+
- name: Send notification to Discord for Check Run
62+
if: github.event_name == 'check_run'
63+
run: |
64+
curl -H "Content-Type: application/json" \
65+
-d "{\"content\": \"New check run completed in repository: ${{ github.repository }}.\"}" \
66+
${{ secrets.DISCORD_WEBHOOK_URL }}
67+
68+
- name: Send notification to Discord for Check Suite
69+
if: github.event_name == 'check_suite'
70+
run: |
71+
curl -H "Content-Type: application/json" \
72+
-d "{\"content\": \"New check suite completed in repository: ${{ github.repository }}.\"}" \
73+
${{ secrets.DISCORD_WEBHOOK_URL }}
74+
75+
- name: Send notification to Discord for Deployment
76+
if: github.event_name == 'deployment'
77+
run: |
78+
curl -H "Content-Type: application/json" \
79+
-d "{\"content\": \"New deployment event in repository: ${{ github.repository }}.\"}" \
80+
${{ secrets.DISCORD_WEBHOOK_URL }}

.github/workflows/issue-slash-cmd.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Close issue on /close
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
jobs:
8+
closeIssueOnClose:
9+
# Skip this job if the comment was created/edited on a PR
10+
if: ${{ !github.event.issue.pull_request }}
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: none
15+
contents: read
16+
17+
steps:
18+
- run: echo "command=false" >> $GITHUB_ENV
19+
20+
- name: Check for /close command
21+
id: check_close_command
22+
run: |
23+
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
24+
echo "command=true" >> $GITHUB_ENV
25+
echo "close_command=true" >> $GITHUB_ENV
26+
echo "reopen_command=false" >> $GITHUB_ENV
27+
else
28+
echo "close_command=false" >> $GITHUB_ENV
29+
fi
30+
31+
- name: Check for /open or /reopen command
32+
id: check_reopen_command
33+
run: |
34+
if [[ "${{ contains(github.event.comment.body, '/open') }}" == "true" ]] || [[ "${{ contains(github.event.comment.body, '/reopen') }}" == "true" ]]; then
35+
echo "command=true" >> $GITHUB_ENV
36+
echo "reopen_command=true" >> $GITHUB_ENV
37+
echo "close_command=false" >> $GITHUB_ENV
38+
else
39+
echo "reopen_command=false" >> $GITHUB_ENV
40+
fi
41+
42+
- name: Check if the user is allowed
43+
id: check_user
44+
if: env.command == 'true'
45+
run: |
46+
ALLOWED_USERS=("fam007e")
47+
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
48+
echo "user=true" >> $GITHUB_ENV
49+
else
50+
echo "user=false" >> $GITHUB_ENV
51+
fi
52+
53+
- name: Close issue if conditions are met
54+
if: env.close_command == 'true' && env.user == 'true'
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
ISSUE_NUMBER: ${{ github.event.issue.number }}
58+
run: |
59+
echo Closing the issue...
60+
if [[ "${{ contains(github.event.comment.body, 'not planned') }}" == "true" ]]; then
61+
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} --reason 'not planned'
62+
else
63+
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
64+
fi
65+
66+
- name: Reopen issue if conditions are met
67+
if: env.reopen_command == 'true' && env.user == 'true'
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
ISSUE_NUMBER: ${{ github.event.issue.number }}
71+
run: |
72+
echo Reopening the issue...
73+
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}

.github/workflows/release.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release Binary
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- nerdfonts_installer.sh
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Environment
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y shc
22+
23+
- name: Install GitHub CLI
24+
run: |
25+
sudo apt-get install -y gh
26+
27+
- name: Authenticate GitHub CLI
28+
run: |
29+
echo "${{ secrets.MY_GITHUB_TOKEN }}" | gh auth login --with-token
30+
31+
- name: Build binary
32+
run: |
33+
shc -f nerdfonts_installer.sh -o release/nerdfonts-installer
34+
chmod +x release/nerdfonts-installer
35+
36+
- name: Create tarball
37+
run: |
38+
version=$(date +'%Y.%m.%d')".$(git rev-list --count HEAD)"
39+
tar -czf "release/nerdfonts-installer-${version}.tar.gz" -C release nerdfonts-installer
40+
echo "Version: ${version}" > release/version.txt
41+
42+
- name: Create release
43+
id: create_release
44+
run: |
45+
version=$(date +'%Y.%m.%d')".$(git rev-list --count HEAD)"
46+
changelog=$(git log --oneline --pretty=format:"* %s (%h)" | head -n 20)
47+
echo "Changelog: $changelog" > release/changelog.txt
48+
49+
gh release create "v${version}" release/nerdfonts-installer release/nerdfonts-installer-${version}.tar.gz release/changelog.txt --title "Release v${version}" --notes "$changelog"
50+
51+
- name: Clean up old binaries
52+
run: |
53+
rm release/nerdfonts-installer

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 fam007e Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)