question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for an include option (in addition to ignore)

See original GitHub issue

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

AFAICS (apologies if I missed smth) electron-packager has a way to ignore paths from getting copied to the output artifact, but blacklisting is a risky way to decide what goes in. Add a file with sensitive info to the repo, forget to add it to ignore, and BAM!

A whitelist is stable and does answer directly the question: what goes into the artifact?

Proposed Solution

In the best of worlds, you should just follow npm pack, meaning respect the files section in package.json, and if none - respect the .npmignore (or just stick to the current --ignore flag).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:12
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
zacharyrankincommented, Jul 24, 2021

👋 I was able to get the regex to work using '^\/(?!(dist|node_modules|package\.json))' (the initial slash ensures it is in the root) … if you include this as a script in your package.json make sure you escape the backslashes, e.g., '^\\/(?!(dist|node_modules|package\\.json))'

2reactions
LordMidicommented, May 24, 2019

Any news here? Please give me an example to exclude everything except one folder i.e. “dist”. I’m getting mad finding a working RegEx to provide it to the “ignore” parameter. This RegEx should work ^(?!.*(dist|node_modules)).* but it doesn’t. Using this as “ignore” param I get no app folder at all - nothing gets copied. I couldn’t figure out what is used internally for the ignore match. Greetings (edit: maybe I have to build a script via the API to fit our project needs)

Read more comments on GitHub >

github_iconTop Results From Across the Web

.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git ignore patterns are used to exclude certain files in your working directory from your Git history. They can be local, global, or...
Read more >
View, manage, and install add-ins for Microsoft 365 programs
View, manage, and install add-ins for Microsoft 365 programs ; Permanently disable or remove an add-in · Click File > Options > Add-ins...
Read more >
gitignore Documentation - Git
Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary files generated by the user's editor of choice)...
Read more >
Add all files to a commit except a single file? - Stack Overflow
git add -u git reset -- main/dontcheckmein.txt. Note: Git has subsequently added special syntax for this, which is explained in other answers.
Read more >
Dockerfile reference - Docker Documentation
Convention is also to include a blank line following any parser directives. ... By adding the escape parser directive, the following Dockerfile succeeds...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found