Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: The API fails if the filesSrc contains only a single file #124

Closed
skilledDeveloper opened this issue Oct 17, 2022 · 3 comments
Closed

Comments

@skilledDeveloper
Copy link

options.filesSrc accepts an array of strings but if you pass a single filename like the following it will fail:

options.filesSrc = ["file1.js"]

The problem is not with the obfuscation process. It happens after that when it tried to write the file in the output directory:

 Error: EISDIR: illegal operation on a directory, open 'OUTOUT_DIR'

Workaround: Adding another file in the filesSrc will fix the issue.

@luisreis-jscr
Copy link
Contributor

Hello. The issue here is that when the project has only a single file, Jscrambler outputs a file instead of outputting a directory.

Is this causing you problems?

@skilledDeveloper
Copy link
Author

Yes. That’s the issue.
If this is the intended behavior, it’s very inconsistent and needs to be changed IMO. In the config, you usually specify an output directory. Regardless of how many files you processed, the result should be sitting there in the output dir.

@luisreis-jscr
Copy link
Contributor

There is a way to turn off this behavior: if you make the filesDest field end in a "/" or "\", it will always output a folder, even if only one single file was protected.

Example: options.filesDest = "dist/";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants