From d013ee7b573deb640e9f67723842abae6d9f717c Mon Sep 17 00:00:00 2001 From: Alessandro ZANNI Date: Fri, 14 Oct 2016 18:07:14 +0200 Subject: [PATCH] change upload function --- pupy/modules/upload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pupy/modules/upload.py b/pupy/modules/upload.py index 5c38a91a..4848d184 100644 --- a/pupy/modules/upload.py +++ b/pupy/modules/upload.py @@ -15,5 +15,7 @@ class UploaderScript(PupyModule): self.arg_parser.add_argument('local_file', metavar='', completer=path_completer) self.arg_parser.add_argument('remote_file', metavar='') def run(self, args): - upload(self.client.conn, args.local_file, self.client.conn.modules['os.path'].expandvars(args.remote_file)) + if args.remote_file.endswith('.'): + args.remote_file = args.remote_file.replace('.', args.local_file.split(os.sep)[-1]) + upload(self.client.conn, args.local_file, args.remote_file) self.success("file local:%s uploaded to remote:%s"%(args.local_file, args.remote_file))