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
When using the writeFile function, the program silently overrides the file content. In this case, you may lose your previous content if you're careful enough.
I propose to create a new module Iris.IO and add a protected writeFile function that:
Takes an argument of type: data ActionFlag = Ask | Force
When Ask is given, it checks for file existence and asks a question, whether user wants to override file content.
The text was updated successfully, but these errors were encountered:
* Added Yes/No functions and multiple choice functions (Issue chshersh#9).
* Added a protected writefile function (Issue chshersh#14)
possible improvements: move to ansi-terminal or other couloring library in order to manage colours in a more scalable way (currently ANSI Escape codes are used)
how should the function behave if "Ask" is combined with NonInteractive? I would say that the sensible default is to NOT overwrite.
Also, what's the response to "overwrite? NO" ? throw an exception?
Edit:
To access the Interactive setting the function would need to run within the App context though.
When using the
writeFile
function, the program silently overrides the file content. In this case, you may lose your previous content if you're careful enough.I propose to create a new module
Iris.IO
and add a protectedwriteFile
function that:data ActionFlag = Ask | Force
Ask
is given, it checks for file existence and asks a question, whether user wants to override file content.The text was updated successfully, but these errors were encountered: