Fix echo usage under macOS

This commit is contained in:
2Shirt 2019-11-10 18:01:07 -07:00
parent 0b6cd1cb6c
commit 6963d2ae71
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -3,6 +3,7 @@
import logging import logging
import pathlib import pathlib
import platform
from wk.exe import run_program from wk.exe import run_program
@ -88,14 +89,18 @@ def prep_action(
action_cmd.append(cmd) action_cmd.append(cmd)
elif text: elif text:
# Display text # Display text
echo_cmd = ['echo']
if platform.system() == 'Linux':
echo_cmd.append('-e')
action_cmd.extend([ action_cmd.extend([
'watch', 'watch',
'--color', '--color',
'--exec', '--exec',
'--no-title', '--no-title',
'--interval', '1', '--interval', '1',
'echo', '-e', text,
]) ])
action_cmd.extend(echo_cmd)
action_cmd.append(text)
elif watch_file: elif watch_file:
# Monitor file # Monitor file
prep_file(watch_file) prep_file(watch_file)