Skip to content

Conversation

@mr-aboutin
Copy link
Contributor

@mr-aboutin mr-aboutin commented Sep 30, 2025

Export Archive name

Added the variable ARCHIVE_NAME to 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.

  • Core:
    • Export ARCHIVE_NAME=\basename "$0"`inmakeself-header.sh` to expose the archive file name to the embedded script.
  • Tests (test/variabletest):
    • Use ARCHIVE_NAME when creating the test archive.
    • Add testArchiveName to assert the exposed ARCHIVE_NAME matches the expected value.

Written by Cursor Bugbot for commit 8dc6b13. This will update automatically on new commits. Configure here.

Export `ARCHIVE_NAME` to give start script access to the name of the archive

Signed-off-by: Alex Boutin <[email protected]>
@mr-aboutin mr-aboutin changed the title feat(variable): Access archive name from script feat ✨ Access archive name from script Sep 30, 2025
@megastep megastep requested a review from Copilot September 30, 2025 02:47
@megastep megastep self-assigned this Sep 30, 2025
Copy link

Copilot AI left a 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_NAME variable 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.

Comment on lines 55 to 59
local ans="${temp}"$'/complicated\n dir\twith spaces'
mkdir -p "${ans}"
cd "${ans}"

actual_archive_name="$("${temp}/makeself-test.run" --quiet)"
Copy link

Copilot AI Sep 30, 2025

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.

Suggested change
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)"

Copilot uses AI. Check for mistakes.
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.

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.

@mr-aboutin
Copy link
Contributor Author

mr-aboutin commented Sep 30, 2025 via email

Adjusted tests

Signed-off-by: Alex Boutin <[email protected]>
@mr-aboutin mr-aboutin requested a review from megastep September 30, 2025 23:41
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.

Looks good to me!

@megastep megastep merged commit 6a29bfb into megastep:master Oct 1, 2025
11 of 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.

2 participants