mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
allow shell plugin to affect remote module filename
Fix for 13368, added get_remote_filename to shell plugins, powershell version appends .ps1 if necessary, base shell plugin no-ops
This commit is contained in:
parent
f873cc0fb5
commit
c94509f273
4 changed files with 13 additions and 6 deletions
|
@ -49,6 +49,13 @@ class ShellModule(object):
|
|||
return path
|
||||
return '"%s"' % path
|
||||
|
||||
# powershell requires that script files end with .ps1
|
||||
def get_remote_filename(self, base_name):
|
||||
if not base_name.strip().lower().endswith('.ps1'):
|
||||
return base_name.strip() + '.ps1'
|
||||
|
||||
return base_name.strip()
|
||||
|
||||
def path_has_trailing_slash(self, path):
|
||||
# Allow Windows paths to be specified using either slash.
|
||||
path = self._unquote(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue