crystal-lang / shards

Dependency manager for the Crystal language
Other
763 stars 100 forks source link

Fix touch install_path to not accidentally create file #478

Closed straight-shoota closed 3 years ago

straight-shoota commented 3 years ago

Fix-up for #444. There's an unconditional touch on ./lib. But that folder might not exist when no dependencies are installed. This ends up creating a file at this path, which is obviously not ideal because later you might want to install dependencies and shards expects a directory.

This patch makes sure to always create the folder.

Ref. https://github.com/crystal-lang/shards/pull/477#issuecomment-783651180

The newly added spec for shard.lock modification time was not broken, but added it for coverage.