repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

fix bootsttripper hostname detection

d4a890733cb516e24a62ba55de6d68ed69fa9bcf

Oliver Jan Krylow <olver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

alacritty/Alacritty.desktop

Mode changed
old mode 100644 new mode 100755

No text changes.

bootstripper.java

Modified
87 87 static String hostname() throws Exception {
88 - var process_builder = new ProcessBuilder();
89 - var operating_system = System.getProperty("os.name");
90 - if(operating_system.toLowerCase().contains("linux")){
91 - process_builder = process_builder.command("hostnamectl", "hostname");
92 - }
93 - else
94 - {
95 - process_builder = process_builder.command("hostname");
96 - }
88 + var process_builder = new ProcessBuilder().command("hostname");
97 89 var process = process_builder
98 90 .start()
99 91 .onExit()
100 92 .join();
93 + if(process.exitValue() != 0) {
94 + process = new ProcessBuilder()
95 + .command("hostnamectl", "hostname")
96 + .start()
97 + .onExit()
98 + .join();
99 + }
101 100 try(var reader = new InputStreamReader(process.getInputStream()))
103 102 int character = -1;

neovim/lua/statusline.lua

Modified
55 55 command = "git",
56 56 args = { "branch", "--show-current" },
57 57 cwd = vim.fn.expand("%:p:h"), -- parent directory of current buffer
58 + maximum_results = 1,
59 + skip_validation = true,
58 60 on_exit = function(output)
59 61 local result = output:result()[1]
60 62 if result then
66 68 command = "svn",
67 69 args = { "info" },
68 70 cwd = vim.fn.expand("%:p:h"), -- parent directory of current buffer
71 + maximum_results = 4,
72 + skip_validation = true,
69 73 on_exit = function(output)
70 74 local result = output:result()[4] -- Relative URL is on the 4th line
71 75 result = result and result:match("Relative URL:%s%^/([%w/]+).*") or nil
77 81 -- simply try all vcs tools at once, and trust that only one returns an answer successfully
78 82 local all = { git, svn }
79 83 for _, tool in pairs(all) do
80 - tool:start()
84 + pcall(tool.start, tool)
83 87 -- generate the statusline string