Skip to content

--extra-resource does not accept directories or wildcards anymore #1852

@TimoKunze

Description

@TimoKunze

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 bug that matches the one I want to file, without success.

Issue Details

  • Electron Packager Version:
    • 19.0.1
  • Electron Version:
    • 38.3.0
  • Operating System:
    • Windows 11 (24H2)
  • Last Known Working Electron Packager version::
    • 18.4.4

Expected Behavior

If the value passed to --extra-resource parameter is a directory instead of a file, the whole directory is copied.

Actual Behavior

If the value passed to --extra-resource parameter (e.g. --extra-resource=out/config) is a directory instead of a file, the command fails with:
Path is a directory: cp returned EISDIR (out/config is a directory (not copied)) out/config

To Reproduce

  • Take any project that you package using electron-packager.
  • Add a directory out/config with some files and sub-directories.
  • Add --extra-resource=out/config to your call of electron-packager.

Additional Information

If we're talking about a low and fixed number of files to copy, it's not a problem to specify --extra-resource for each file individually. But in my case it's a variable number of files and it can easily be several dozen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions