-
-
Notifications
You must be signed in to change notification settings - Fork 398
feat ✨ Access archive name from script #348
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
Conversation
Export `ARCHIVE_NAME` to give start script access to the name of the archive Signed-off-by: Alex Boutin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the ability for embedded scripts in makeself archives to access the archive's filename through a new ARCHIVE_NAME environment variable.
- Exports
ARCHIVE_NAMEvariable in the makeself header script containing the basename of the archive file - Updates the test suite to use the new variable and validate its functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| makeself-header.sh | Adds ARCHIVE_NAME variable export using basename "$0" |
| test/variabletest | Updates test to use ARCHIVE_NAME variable and adds test case to validate it |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
test/variabletest
Outdated
| local ans="${temp}"$'/complicated\n dir\twith spaces' | ||
| mkdir -p "${ans}" | ||
| cd "${ans}" | ||
|
|
||
| actual_archive_name="$("${temp}/makeself-test.run" --quiet)" |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test logic is incorrect. The variable ans represents a directory path with special characters, but the test is comparing actual_archive_name (which should be the archive filename) with ARCHIVE_NAME (which is 'makeself-test.run'). The ans variable and directory creation are unnecessary for testing the archive name functionality.
| local ans="${temp}"$'/complicated\n dir\twith spaces' | |
| mkdir -p "${ans}" | |
| cd "${ans}" | |
| actual_archive_name="$("${temp}/makeself-test.run" --quiet)" | |
| actual_archive_name="$("./makeself-test.run" --quiet)" |
megastep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it - Copilot seems to have a point about the purpose of this test as this doesn't seem to be testing what is actually happening within the script. ARCHIVE_NAME here is set before running the scripts.
|
Of course, I could change the setup method to check for a second argument
and, if passed, would use that has the filename, if that's okay with you.
I didn't want to change too much of the tests so I based it on the existing
ones but I scope the test better.
…On Mon, Sep 29, 2025, 22:53 Stéphane Peter ***@***.***> wrote:
***@***.**** requested changes on this pull request.
I like it - Copilot seems to have a point about the purpose of this test
as this doesn't seem to be testing what is actually happening within the
script. ARCHIVE_NAME here is set before running the scripts.
—
Reply to this email directly, view it on GitHub
<#348 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQXK3GXAHZ2XJCZN5JFAEZD3VHWBFAVCNFSM6AAAAACH3BXZQSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTEOBSGQYDEOJZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Adjusted tests Signed-off-by: Alex Boutin <[email protected]>
megastep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Export Archive name
Added the variable
ARCHIVE_NAMEto the makeself header to give the start script access not only to the archive directory but also it's name.Note
Expose
ARCHIVE_NAME(basename of the archive) to the start script and add tests validating it.ARCHIVE_NAME=\basename "$0"`inmakeself-header.sh` to expose the archive file name to the embedded script.test/variabletest):ARCHIVE_NAMEwhen creating the test archive.testArchiveNameto assert the exposedARCHIVE_NAMEmatches the expected value.Written by Cursor Bugbot for commit 8dc6b13. This will update automatically on new commits. Configure here.