Skip to content

functions: add_file: use the source file name if the destination ends with a slash

nl6720 requested to merge nl6720/mkinitcpio:add_file-dest-is-a-dir into master

functions: add_file: use the source file name if the destination ends with a slash

If the destination ends with a slash, then the source's file name is kept, but this is not visible in the verbose output. Use ${dest/%\//\/${src##*/}} in both messages so that the file name is correctly displayed.

Use add_dir to create the directory since install will not create the last component of the path.

test/cases/functions.bats: add more add_file tests

  • add_file regular file
  • add_file with mode
  • add_file target is a directory
Edited by nl6720

Merge request reports

Loading