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

Add a pre-extract script (issue #242) #325

Merged
merged 4 commits into from
Mar 24, 2024
Merged

Conversation

mpoberezhniy
Copy link
Contributor

@mpoberezhniy mpoberezhniy commented Mar 23, 2024

Description #242:

Being able to specify a pre-extraction script can significantly improve user experience when dealing with large archives by doing the following before decompressing and failing fast.

  • Validating user input i.e. passed options
  • Validating system requirements

The pre-extraction script can be written in any programming language as long as it provides a shebang. It receives the same cli arguments as the main script. It will be executed in the target dir, it allows asking for user input and passing it to the main script as shown in testPreextractEnvPassing test.

The pre-extraction script is stored in the header as a variable. When it is used - a file with the stored contents is created and run.

@mpoberezhniy mpoberezhniy changed the title Add a pre-extract script (#242) Add a pre-extract script (issue #242) Mar 23, 2024
@megastep megastep self-requested a review March 23, 2024 23:45
@megastep
Copy link
Owner

Interesting contribution thanks! Your tests seem to fail at least on macOS but if you manage to make it pass on all platforms I'd be inclined to approve it.

@mpoberezhniy
Copy link
Contributor Author

@megastep Thanks for the review. I pushed a commit that should resolve the mktemp issues and also when testing on an alpine container I hit an issue with --show-preextract displaying not exactly what was provided to it (\\t instead of \t), so it should be fixed with encoding.

Copy link
Owner

@megastep megastep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me!

@megastep megastep merged commit 271b54a into megastep:master Mar 24, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants