Skip to content

Improve error message when using extractZip/extract7z/extractTar with a non-existing destination #213

@Anupheaus

Description

@Anupheaus

Describe the enhancement
When extracting to a path that does not yet exist, the error message given, when using the methods in the title, provides a ENOENT error code and specifically identifies the location of the tool as the source of the issue.

Originally mentioned in issue #82

Code Snippet
Unfortunately this is a modification of the bundled output, but you get the idea:

function extractZipNix(file, dest) {
    return __awaiter(this, void 0, void 0, function* () {
        if(!fs.existsSync(dest)) { throw new Error('The destination path for extraction does not exist.'); }
        const unzipPath = yield io.which('unzip');
        yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions