Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Deletion of entire alias file #5

Open
dawsbot opened this issue Apr 4, 2017 · 5 comments
Open

🐛 Deletion of entire alias file #5

dawsbot opened this issue Apr 4, 2017 · 5 comments
Labels

Comments

@dawsbot
Copy link
Owner

dawsbot commented Apr 4, 2017

I think this is why: Under situations where config.json is 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.

@dawsbot dawsbot added the bug label Apr 4, 2017
@rcornacchia
Copy link

Facing this issue, though it seems the config.json is valid json. Periodically, this issue occurs. Not sure how to reproduce it.

@dawsbot
Copy link
Owner Author

dawsbot commented Apr 27, 2017

I was able to replicate the issue with the following alias:

echo \$\1

Need to take a peek into dependencies to figure out why

@dawsbot
Copy link
Owner Author

dawsbot commented Dec 15, 2017

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.

@dawsbot
Copy link
Owner Author

dawsbot commented Apr 16, 2018

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!

@dawsbot dawsbot closed this as completed in 6ecb37d Aug 5, 2018
@dawsbot
Copy link
Owner Author

dawsbot commented Aug 5, 2018

Re-opening until we can confirm this issue is entirely gone

@dawsbot dawsbot reopened this Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants