Commit 0d4f2676 authored by Duncan Bayne's avatar Duncan Bayne

Add function to ensure Syncthing isn't running

parent 99fc9996
......@@ -122,6 +122,15 @@
(term-send-raw-string "killall syncthing\n")
(term-send-raw-string "syncthing\n"))))
(defun utils:ensure-syncthing-stopped ()
"Ensures syncthing is not running."
(if (member "*syncthing*" (utils:term-buffer-names))
(shell-command "killall syncthing")
(utils:create-or-switch-to-term "syncthing")
(term-send-raw-string "exit\n"))))
(defun utils:safe-shell-command (command)
"Runs a shell command, and raises an error if it fails."
(if (not (= 0 (shell-command command)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment