Replace 7zip-bin with WinRAR for archive extraction v1.3.0
- Remove 7zip-bin dependency and asarUnpack config - Use WinRAR/UnRAR.exe from standard install paths with auto-detection - Add resolver with probing to cache the found extractor command - Add -y flag for auto-confirm and WinRAR.exe command support - Update tests for WinRAR argument format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d867c55e37
commit
73c8b6e670
+10
-17
@@ -15,36 +15,29 @@ afterEach(() => {
|
||||
|
||||
describe("extractor", () => {
|
||||
it("maps external extractor args by conflict mode", () => {
|
||||
expect(buildExternalExtractArgs("7z", "archive.rar", "C:\\target", "overwrite")).toEqual([
|
||||
expect(buildExternalExtractArgs("WinRAR.exe", "archive.rar", "C:\\target", "overwrite")).toEqual([
|
||||
"x",
|
||||
"-o+",
|
||||
"-p-",
|
||||
"-y",
|
||||
"-aoa",
|
||||
"-p",
|
||||
"archive.rar",
|
||||
"-oC:\\target"
|
||||
"C:\\target\\"
|
||||
]);
|
||||
expect(buildExternalExtractArgs("7z", "archive.rar", "C:\\target", "ask")).toEqual([
|
||||
expect(buildExternalExtractArgs("WinRAR.exe", "archive.rar", "C:\\target", "ask", "serienfans.org")).toEqual([
|
||||
"x",
|
||||
"-y",
|
||||
"-aos",
|
||||
"-p",
|
||||
"archive.rar",
|
||||
"-oC:\\target"
|
||||
]);
|
||||
expect(buildExternalExtractArgs("7z", "archive.rar", "C:\\target", "ask", "serienfans.org")).toEqual([
|
||||
"x",
|
||||
"-y",
|
||||
"-aos",
|
||||
"-o-",
|
||||
"-pserienfans.org",
|
||||
"-y",
|
||||
"archive.rar",
|
||||
"-oC:\\target"
|
||||
"C:\\target\\"
|
||||
]);
|
||||
|
||||
const unrarRename = buildExternalExtractArgs("unrar", "archive.rar", "C:\\target", "rename");
|
||||
expect(unrarRename[0]).toBe("x");
|
||||
expect(unrarRename[1]).toBe("-or");
|
||||
expect(unrarRename[2]).toBe("-p-");
|
||||
expect(unrarRename[3]).toBe("archive.rar");
|
||||
expect(unrarRename[3]).toBe("-y");
|
||||
expect(unrarRename[4]).toBe("archive.rar");
|
||||
});
|
||||
|
||||
it("deletes only successfully extracted archives", async () => {
|
||||
|
||||
Reference in New Issue
Block a user