kusnier / vagrant-persistent-storage

A Vagrant plugin that creates a persistent storage and attaches it to guest machine.
MIT License
292 stars 68 forks source link

If location is relative consider it under machine's root directory #99

Closed dimara closed 5 years ago

dimara commented 5 years ago

Commit https://github.com/kusnier/vagrant-persistent-storage/commit/7f9e1743ff205ca391e37c093fde76e79cfbcda2 tried to fix issue https://github.com/kusnier/vagrant-persistent-storage/issues/5 but did not take into account that vagrant commands can be called outside root directory using the machine id. In such a case upon vagrant destroy the "persistent" storage gets deleted since it never gets detached.

The above could be fixed if non-absolute paths are considered relative to the machine's root directory, which is reasonable enough. The root directory can be found via @global_env.root_path inside actions or via machine.env.root_path inside config.rb.

kusnier commented 5 years ago

Thank you for the pull request in #100 A new version with you fix is available: 0.0.46