🐛 Deletion of entire alias file
I think this is why: Under situations where
config.jsonis invalid json,
The entire file is deleted upon transpilation of aliases. This is an issue because it means if you do not backup your aliases, all are gone when executing pluc --transpile.
A proposed fix would be to avoid writing to config.json if the object is empty or smaller than the previous object.
Facing this issue, though it seems the config.json is valid json. Periodically, this issue occurs. Not sure how to reproduce it.
I was able to replicate the issue with the following alias:
echo \$\1
Need to take a peek into dependencies to figure out why
Able to replicate this issue by saving two aliases with the same key back-to-back.
Proposed Solution
If JSON object has fewer entries than it did before the recent call, do not save to file.
Solved! Spotted the issue at least. One solution is to halt reading from the json object if it's invalid json: https://github.com/dawsbot/dotless-conf/issues/2
Will work on this at a later time, but if anyone wants to take on that ticket go for it!
Re-opening until we can confirm this issue is entirely gone