Sha256: 864d814b8cc8de95f1c0cec488a456ba30cb2149817c33628b6062dbbdb64130
Contents?: true
Size: 738 Bytes
Versions: 31
Compression:
Stored size: 738 Bytes
Contents
require "shellwords" 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 = Shellwords.split(command.strip) 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 27 versions & 4 rubygems