Sha256: 73a232fdc1f24edd958f18861b93c2f97a02d7eede562303f30e17360541beb4
Contents?: true
Size: 707 Bytes
Versions: 31
Compression:
Stored size: 707 Bytes
Contents
module VagrantPlugins module CommunicatorWinRM module CommandFilters # Converts a *nix 'mkdir' command to a PowerShell equivalent class Mkdir def filter(command) # mkdir -p /some/dir # mkdir /some/dir cmd_parts = command.strip.split(/\s+/) dir = cmd_parts.pop while !dir.nil? && dir.start_with?('-') dir = cmd_parts.pop end # This will ignore any -p switches, which are redundant in PowerShell, # and ambiguous in PowerShell 4+ return "mkdir #{dir} -force" end def accept?(command) command.start_with?('mkdir ') end end end end end
Version data entries
31 entries across 28 versions & 5 rubygems