Skip to content

fix(task) #16 ZipTask: only remove the leading files_base_path, read relative paths from the current directory - #20

Merged
njoubert-cleverage merged 1 commit into
15from
16
Sep 30, 2026
Merged

njoubert-cleverage merged 1 commit into
15from
16

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #16. Based on #19 (merge it first, this PR will then target main).

ZipTask built the archive entry names with str_replace($files_base_path, '', $file) and always prefixed the read path with files_base_path.'/':

  • every occurrence of files_base_path was removed, not only the leading one: a path containing it again was looked for at a wrong path (File does not exists);
  • with the default empty files_base_path, relative paths were resolved from the filesystem root.

Changes:

  • ZipTask::execute(): remove files_base_path only when the path starts with it followed by a directory separator (a trailing separator in files_base_path is ignored); other paths stay relative to files_base_path, as before. With an empty files_base_path, read the file at the given path (absolute or relative to the current directory); the entry name is unchanged (the path without its leading /)
  • ZipTaskTest: a path containing files_base_path twice, a relative path without files_base_path (both fail without the fix)
  • zip_task.md: update the files option and the notes

Checked with demo.archive.zip_files_base_path (entry demo_zip_files_base_path/backup/var/data/archived_file.txt) and demo.archive.zip_relative_path (entry var/data/sample.txt) in process-bundle-demo: both failed with File does not exists before.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: the affected configurations failed (File does not exists) or added the wrong file. Absolute paths starting with files_base_path (once) and paths relative to files_base_path behave as before.

🤖 Generated with Claude Code

…he file paths, and reads the files at the given path when files_base_path is empty

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage njoubert-cleverage added the bug Something isn't working label Sep 30, 2026
@njoubert-cleverage njoubert-cleverage self-assigned this Sep 30, 2026
@njoubert-cleverage
njoubert-cleverage merged commit bfcdafe into 15 Sep 30, 2026
17 checks passed
njoubert-cleverage added a commit that referenced this pull request Sep 30, 2026
…stacked base branches)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant