mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-06-10 21:38:26 +02:00
fake-editor: Prefix save message with an "s"
With this, we can distinguish "save" from "close" This fixes issue #160
This commit is contained in:
parent
751b3b24a3
commit
f4a1230e77
2 changed files with 8 additions and 5 deletions
scripts
|
@ -28,10 +28,12 @@ my $new_content = "";
|
|||
$socket->recv($new_content, $length);
|
||||
|
||||
# Write content back into the file.
|
||||
my $handle;
|
||||
open ($handle,'>',$absolute_path) or die("Error opening file");
|
||||
print $handle $new_content;
|
||||
close ($handle) or die ("Error closing file");
|
||||
if ($new_content =~ /^s/) {
|
||||
my $handle;
|
||||
open ($handle,'>',$absolute_path) or die("Error opening file");
|
||||
print $handle (substr $new_content, 1);
|
||||
close ($handle) or die ("Error closing file");
|
||||
}
|
||||
|
||||
# This call is intended to block, we're waiting for Godot to close the connection.
|
||||
my $reply;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue