You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it's really annoying and completely beats the purpose of automated writing to the file if it destroys the formatting in the process.
Since it only has to check if the given field is present and overwrite it, or if not present append the field to the end of file, I don't think this needs a full parser reimplementation, and probably should be handled as its own case.
Let me now if this sounds reasonable to you.
The text was updated successfully, but these errors were encountered:
This is a serious problem. If nothing else, the --add option should simply be removed. If you can't do it nicely, don't do it at all.
The documentation says nothing about this behavior, and it's really problematic. I think the number of issues that have been opened about it should be a decent indicator of how serious this is to people.
In my case, I had some blocks written, but commented out (temporarily). I hadn't yet committed my changes, and travis encrypt --add deleted all of the comments from the file! Saving your work doesn't help you much if a script's undocumented behavior overwrites your saved file.
And to those who think, "well you should have committed first", you may be right. I still think that it's unacceptable for travis to delete content like it does.
It's quite surprising that a command to --add a secure key would result in modifications to other parts of the code that have comments attached.
For individuals that are setting up and committing what a given secure key does within travis.yml for the first time, with multiple secure keys, the behaviour to strip out comments is very annoying.
If you are unable to write your own parser to preserve the comments then just have a command such as travis encrypt --add KEY=SECRET_KEY and just output the result for others to manually add to travis.yml file...
I know this has been already discussed in #316, #144 and travis-ci/travis-ci#9248
But it's really annoying and completely beats the purpose of automated writing to the file if it destroys the formatting in the process.
Since it only has to check if the given field is present and overwrite it, or if not present append the field to the end of file, I don't think this needs a full parser reimplementation, and probably should be handled as its own case.
Let me now if this sounds reasonable to you.
The text was updated successfully, but these errors were encountered: