LibraryManager
LibraryManager copied to clipboard
Add "Force" flag to Restore
Feature request
Add "Force" flag to Restore
Functional impact
I have a web project with a libman entry for a library project I've installed using the filesystem provider. As I make changes to the library files, they are not updated in the target project even after a restore.
I've gotten around the issue by using the libman CLI to clean and restore as a pre-build step, but it'd be nice to have a force flag available in the config (and in the CLI for that matter) for restoring.
When using the filesystem provider one could maybe even have an option to update the file @ source when edited from the using project OR the files could be marked as read only so you are forced to update them in the library location.
In our case we use LibMan to share TS/JS components between projects, and it would be great with some sort of functionality that could help keep the files in sync across projects.
I'm currently using npm to get packages and then libman with a filesystem provider to copy the desired files from node_modules to the desired locations. The problem I'm running into is the same as here, in that even when I upgrade the package with npm, the files don't get copied on build. I believe this is due to the fact that the files from npm all seem to have a write time in 1985, ~~so the file isn't being considered updated. There is a file size difference, which should also trigger an overwrite, so I do think I'm missing something...~~ (this code doesn't seem to be used by the filesystem provider...)
A force flag would fix my issue, but aside from that, allowing for other checks to determine if a file is updated would also be useful (e.g. comparing file size or a file hash). Also, allowing for a proxy file (containing version number or what have you) at the library level to decide if files should be recopied may also be worth considering.