Skip to content

Commit 4c4faac

Browse files
committed
Add zellij
1 parent 9dd7cba commit 4c4faac

File tree

8 files changed

+60
-10
lines changed

8 files changed

+60
-10
lines changed

Bootstrapfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ end
2929

3030
unix do
3131
install "zsh"
32+
install "zellij"
3233
install "rbenv"
3334
install "nvm"
3435
install "rcm"

bashrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
# zellij
4+
export ZELLIJ_AUTO_EXIT=true
5+
eval "$(zellij setup --generate-auto-start bash)"
6+
37
# aliases
48
alias b="bundle"
59
alias be="bundle exec"

bootstrap/lib/bootstrap/package/sources.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,11 @@ xournalpp:
161161

162162
alacritty:
163163
ubuntu:
164-
snap: true
164+
snap: true
165+
166+
zellij:
167+
ubuntu:
168+
snap: true
169+
fedora:
170+
dnf:
171+
copr: varlad/zellij

bootstrap/lib/bootstrap/package_manager.rb

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,24 @@ def install(package_name)
133133
end
134134

135135
def source(repo)
136+
if repo.key?("copr")
137+
source_copr(repo)
138+
else
139+
source_repo(repo)
140+
end
141+
end
142+
143+
def sudo?
144+
true
145+
end
146+
147+
private
148+
149+
def source_copr(repo)
150+
dnf("copr", "enable", "-y", repo["copr"])
151+
end
152+
153+
def source_repo(repo)
136154
return if repo_exists?(repo)
137155

138156
repo_file = repo["name"].downcase.gsub(" ", "-")
@@ -144,12 +162,6 @@ def source(repo)
144162
dnf("update")
145163
end
146164

147-
def sudo?
148-
true
149-
end
150-
151-
private
152-
153165
def repo_exists?(repo)
154166
Dir["/etc/yum.repos.d/*"].find do |file|
155167
File.read(file).match?(repo["baseurl"])

bootstrap/test/bootstrap/package_test.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class PackageFedoraInstallTest < PackageInstallTest
184184
end
185185
end
186186

187-
test "#install on fedora with third party source" do
187+
test "#install on fedora with third party repo source" do
188188
repo_source = {
189189
"name" => "test", "baseurl" => "testuri", "gpgkey" => "testgpgkey",
190190
}
@@ -202,6 +202,24 @@ class PackageFedoraInstallTest < PackageInstallTest
202202
end
203203
end
204204

205+
test "#install on fedora with third party copr source" do
206+
copr_source = {
207+
"copr" => "some/repo"
208+
}
209+
210+
with_ruby_platform("Linux") do
211+
with_linux_version("Red Hat") do
212+
assert_called(Package, :sources, returns: test_dependencies) do
213+
assert_called_with(Dnf, :source, [copr_source]) do
214+
assert_called_with(Dnf, :install, %w(other-third-party-pkg)) do
215+
third_party_package.install
216+
end
217+
end
218+
end
219+
end
220+
end
221+
end
222+
205223
test "#install on fedora with script source" do
206224
with_ruby_platform("Linux") do
207225
with_linux_version("Red Hat") do

bootstrap/test/fixtures/files/sources.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ third-party-pkg:
88
name: test
99
baseurl: testuri
1010
gpgkey: testgpgkey
11-
11+
12+
other-third-party-package:
13+
fedora:
14+
copr: some/repo
1215

1316
script-pkg:
1417
macos:

test/bootstrap/macos_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ class MacosTest < TestCase
6060
assert_brew_installed("fd")
6161
end
6262

63+
test "installs zellij" do
64+
assert_brew_installed("zellij")
65+
end
66+
6367
if gui?
6468
test "installs iterm2" do
6569
assert_brew_cask_installed("iterm2")

zshrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/zsh
22

3+
source ~/.bashrc
4+
35
source ~/.zsh/antigen/bin/antigen.zsh
46

57
antigen use oh-my-zsh
@@ -11,6 +13,5 @@ antigen bundle zsh-users/zsh-syntax-highlighting
1113
antigen apply
1214

1315
source ~/.zsh/themes/sparkle.zsh-theme
14-
source ~/.bashrc
1516

1617
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local

0 commit comments

Comments
 (0)