Skip to content

Commit

Permalink
alacritty tag
Browse files Browse the repository at this point in the history
  • Loading branch information
haomingw committed Oct 29, 2024
1 parent d0c2954 commit 1c199f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion alacritty/alacritty.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import = ["~/.config/alacritty/monokai_pro.toml"]

[cursor]
style = "Underline"
Expand All @@ -18,3 +17,6 @@ padding.y = 10
[window.dimensions]
columns = 110
lines = 35

[general]
import = ["~/.config/alacritty/monokai_pro.toml"]
4 changes: 2 additions & 2 deletions common/functions
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ getdate() {

get_tag() {
local user=$(echo "$1" | cut -d/ -f1)
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
if [[ -z "${TOKEN:-}" ]]; then
curl -sSL "https://github.com/$1/tags" | grep -o "$user.*.zip" | grep -vE "\-rc|nightly|pre|beta" | head -n1 | getv
else
local auth="Authorization: Bearer $GITHUB_TOKEN"
local auth="Authorization: Bearer $TOKEN"
local tag=$(curl --silent --header "$auth" "https://api.github.com/repos/$1/releases/latest" | jq -r .tag_name)
if [[ "$tag" == null ]]; then
curl --silent --header "$auth" "https://api.github.com/repos/$1/tags" | jq -r '.[0].name'
Expand Down
7 changes: 5 additions & 2 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ download_to() {
if program_exists wget; then
wget "$1" -P "$2"
else
curl -fsSL "$1" > "$2/$name"
curl -fsSL "$1" > "$2/$name" || {
error "error downloading from $1"
return 1
}
fi
}

Expand Down Expand Up @@ -836,7 +839,7 @@ config_terminal() {
fi

repo="alacritty/alacritty"
version=$(download_stdout "https://github.com/$repo/tags" | grep -oE "releases/tag/v[0-9.]+" | head -n1 | getv)
version=$(get_tag "$repo" | grep -oE '[0-9\.]+')
url="$repo/releases/download/v$version/Alacritty-v$version.dmg"
if macos_has Alacritty; then
# check update and download without confirmation
Expand Down
Binary file modified zsh/netrc.gpg
Binary file not shown.

0 comments on commit 1c199f7

Please sign in to comment.