From 7f150ae17a4ab72fdf8290144f247c37f89e2ee4 Mon Sep 17 00:00:00 2001 From: jpic Date: Sun, 2 Aug 2020 06:52:03 +0200 Subject: [PATCH] New write with bash heredoc --- shlax/targets/base.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shlax/targets/base.py b/shlax/targets/base.py index 7f0aa6c..28dbb45 100644 --- a/shlax/targets/base.py +++ b/shlax/targets/base.py @@ -169,8 +169,13 @@ class Target: async def read(self, path): return (await self.exec('cat', self.path(path))).out - async def write(self, path, content): - return await self.exec('echo ' + content + ' > ' + self.path(path)) + async def write(self, path, content, **kwargs): + return await self.exec( + f'cat > {self.path(path)} <