xp-forge / lambda

AWS Lambda for the XP Framework
3 stars 0 forks source link

Resolve symlinks #25

Closed thekid closed 11 months ago

thekid commented 11 months ago

Using path repositories in Composer, I've added a library from a local filesystem path. Composer will create a symlink to this and make everything work with autoloading.

$ ls -al vendor/enbwag
total 8
drwxr-xr-x 2 thekid thekid 4096 Oct  6 17:41 .
drwxr-xr-x 7 thekid thekid 4096 Oct  6 17:41 ..
lrwxrwxrwx 1 thekid thekid   41 Oct  6 17:41 empower-foundation -> /home/thekid/devel/lib/empower-foundation

However, when packaging, we should resolve symlinks instead of following them, which results in the following ZIP file:

$ unzip -l function.zip
Archive:  function.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2023-10-06 16:29   vendor/
        0  2023-10-06 16:29   vendor/enbwag/
        0  2023-10-06 16:29   vendor/enbwag/empower-foundation/
        0  2023-10-06 16:29   ../../lib/empower-foundation/src/
# ...
thekid commented 11 months ago

Implemented in https://github.com/xp-forge/lambda/releases/tag/v5.1.0