We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03f564d commit 22b3f43Copy full SHA for 22b3f43
runce/cli.py
@@ -130,6 +130,8 @@ class Tail(Main):
130
p_close: str = ""
131
132
def start(self) -> None:
133
+ import sys
134
+
135
if self.format == "no":
136
hf = None
137
else:
@@ -150,7 +152,14 @@ def start(self) -> None:
150
152
stdout.buffer.write(tail_bytes(x[out], int(lines[0])))
151
153
elif lines[0] > 0:
154
# TODO: pythonify
- cmd = ["tail", "-n", str(int(lines[0])), x[out]]
155
+ if sys.platform.startswith("win"):
156
+ cmd = [
157
+ "powershell",
158
+ "-c",
159
+ f"Get-Content -Tail {int(lines[0])} '{x[out]}'",
160
+ ]
161
+ else:
162
+ cmd = ["tail", "-n", str(int(lines[0])), x[out]]
163
if self.tab:
164
with Popen(cmd, stdout=PIPE).stdout as o:
165
for line in o:
0 commit comments