isaacs / isaacs/node-tar

[FEATURE] Add ability to ignore files if they don't exist

Open
#253 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
JavaScript
Stars
922
Forks
281
PR merge metrics
No merged PRs in 30d

Description

What / Why

Would be nice if there was a way to specify in the tar options to ignore files if they don't exist.

In my code, I am specifying a list of files that I want to compress into an archive, but it's in a dynamic directory so sometimes the files get removed. This will spit out an error with lstat saying that it does not exist.

When

Simply have an argument in the options table for tar.c

How

Could probably do it and have it almost like a "less strict" mode. When the file is being retrieved for the archive, have a checker that is like if(!fs.existsSync(file)) { return } or something.

Current Behavior

Feeding in a list of files in an array, and having one of them not exist will pass an error.

Expected Behavior

Having an option to specify something like ignoreNotFound should have it just ignore any entries in the array that do not exist.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the tar.c entry point and inspect how the options table is handled and how missing files currently produce lstat errors. Define completion as an option that skips nonexistent entries while preserving normal errors for other failures, then verify the behavior with the existing test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.