Closed ashiroji closed 10 months ago
Hi @ashiroji, sorry for the very late reply.
I cannot reproduce this behaviour unfortunately. Can you please give us some more information on how to reproduce this?
I'll try to describe as much as possible. Feel free to ask for more details.
Steps to reproduce error:
mkdir test_folder
git init .
doorstop create SRD ./reqs/srd
doorstop add SRD
doorstop edit SRD001
Steps to correctly edit:
mkdir test_folder
git init .
doorstop create SRD ./reqs/srd
doorstop add SRD
doorstop edit -a SRD001
or doorstop edit SRD
Verification process:
doorstop edit SRD001
I think I understand. It seems that you are using the default text editor in Mac OS, is that correct?
I just tried that and it fails miserably for me before I even get the file opened. The TextEdit.app is not really suited to edit files in this manner, so I would suggest that you install and use another text editor that is meant to be used from the terminal.
You can use Homebrew for this, e.g., brew install joe
or another editor. You can then test it out by setting the editor directly on the command line like this: EDITOR=joe doorstop edit SRD001
Thank you very much. it works with joe. I also tried vim and it worked. Can you please explain why?
I can try... :)
doorstop is a Python program and is used from the command line. It expects the editor to start and then waits for the editor to stop executing, i.e., when you save and exit, before it continues handling the temporary file it supplied to the editor.
TextEdit.app, and I would suspect a lot of other GUI-based applications, say Word in Windows, does not really work like that because they spawn new processes in the OS to run. This causes doorstop to believe that the editor is done while it is actually just starting itself. Since doorstop then removes the temporary file, TextEdit does not have it when it is trying to save causing the issue you see.
So it's basically a question of a mismatch in how some editors work and how doorstop expects them to work.
While certainly possible to solve, it would require a lot more code to try to catch the spawned subprocesses, which would make doorstop a lot more complex for no good reason. A command line text editor will start a lot faster for instance than a complex GUI-app.
I'm going to close this issue with this explanation.
Hello, I'm new to doorstop and trying to understand how to use it correctly. I have a very simple tree containing just a single req REQ001.yml. I noticed that when using the command:
doorstop edit REQ001
the new text is not saved, but when using the command:doorstop edit -a REQ001
or the commanddoorstop edit REQ
the new text is saved correctly is there something that I'm missing?