In a GitHub action, I'd like to remove the old bundle files from the FTP server after deploying the new bundle. To achieve this, I thought to
- Deploy new bundle
- Parse the hashes of (
main-\*.js
,polyfills-\*.js
etc) - Remove all matching files except the ones with the new hash
For (3), I intended using lftp with mrm main-*.!(328276e83108ad3616fd).js
. Yet, this does not seem to match the expected pattern by lftp. Shopts exglob is activated in the parent shell, yet I fear this has no impact on lftp.
Any hints on how to achieve above goal are highly appreciated. Thanks!