Update 2025-01-28

This commit is contained in:
2025-01-28 19:27:12 +02:00
parent 9743b5c953
commit 7344a9e77a
31 changed files with 34 additions and 24 deletions

View File

@@ -175,8 +175,8 @@ local INPUT_OPTIONS_TABLE = {
-- The extractor names
---@enum ExtractorName
local ExtractorName = {
SevenZip = "7z",
Tar = "tar",
SevenZip = "7-Zip",
Tar = "Tar",
}
-- The extract behaviour flags
@@ -270,7 +270,7 @@ function Extractor:extract(_)
}
end
-- The 7z extractor
-- The 7-Zip extractor
---@class SevenZip: Extractor
---@field password string The password to the archive
local SevenZip = Extractor:subclass({
@@ -286,7 +286,7 @@ local SevenZip = Extractor:subclass({
password = "",
})
-- The tar extractor
-- The Tar extractor
---@class Tar: Extractor
local Tar = Extractor:subclass({
name = ExtractorName.Tar,
@@ -303,7 +303,7 @@ local Tar = Extractor:subclass({
},
})
-- The default extractor, which is set to 7zip
-- The default extractor, which is set to 7-Zip
---@class DefaultExtractor: SevenZip
local DefaultExtractor = SevenZip:subclass({})

View File

@@ -145,11 +145,11 @@ local function setup(st, opts)
end
if not change or signs[change] == "" then
return ui.Line("")
return ""
elseif self._file:is_hovered() then
return ui.Line { ui.Span(" "), ui.Span(signs[change]) }
return ui.Line { " ", signs[change] }
else
return ui.Line { ui.Span(" "), ui.Span(signs[change]):style(styles[change]) }
return ui.Line { " ", ui.Span(signs[change]):style(styles[change]) }
end
end, opts.order)
end
@@ -159,7 +159,10 @@ local function fetch(_, job)
local repo = root(cwd)
if not repo then
remove(tostring(cwd))
return 1
if not ya.__250127 then -- TODO: remove this
return 1
end
return true
end
local paths = {}
@@ -175,8 +178,11 @@ local function fetch(_, job)
:stdout(Command.PIPED)
:output()
if not output then
ya.err("Cannot spawn git command, error: " .. err)
return 0
if not ya.__250127 then -- TODO: remove this
ya.err("Cannot spawn git command, error: " .. err)
return 0
end
return true, Err("Cannot spawn `git` command, error: %s", err)
end
local changed, ignored = {}, {}
@@ -202,7 +208,10 @@ local function fetch(_, job)
end
add(tostring(cwd), repo, changed)
return 3
if not ya.__250127 then -- TODO: remove this
return 3
end
return false
end
return { setup = setup, fetch = fetch }