Skip to content

Commit 4754b21

Browse files
committed
partially refactor listArchive function (index.ts)
1 parent b44c004 commit 4754b21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ export const listArchive =
329329
// Create a string that can be parsed by `run`.
330330
let command = 'l "' + filepath + '" ';
331331
// Start the command
332-
const executables = ['7z', '7za'];
333-
let position = isWindows() ? 0 : 1; // Windows - 2 attempts, others - 1 attempt
332+
const executables = isWindows() ? ['7z', '7za'] : ['7za'];
333+
let position = 0;
334334
const runner = () => Run(executables[position], command, options, override)
335335
.progress((data: string) => progress(onprogress(data)))
336-
.then((args: any) => resolve(position === 1 && isWindows() ? args : spec))
336+
.then((args: any) => resolve(position === 0 ? spec : args))
337337
.catch((err: any) => {
338338
if (position === executables.length - 1) return reject(err);
339339
console.error('ListArchive failed using `' + executables[position] +

0 commit comments

Comments
 (0)