Defaults(
     this ICopyFileSettings settings,
     Bam.Core.Module module)
 {
     settings.Force                 = true;
     settings.Verbose               = true;
     settings.Recursive             = (module is CollatedDirectory);
     settings.PreserveAllAttributes = true;
 }
示例#2
0
        Convert(
            this ICopyFileSettings settings,
            Bam.Core.StringArray commandLine)
        {
            var module = (settings as Bam.Core.Settings).Module;

            if (module.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
            {
                if (settings.Force)
                {
                    commandLine.Add("/Y");
                }
                if (settings.Verbose)
                {
                    commandLine.Add("/F");
                }
                if (settings.Recursive)
                {
                    commandLine.Add("/S");
                }
                if (settings.PreserveAllAttributes)
                {
                    commandLine.Add("/K"); // copy attributes
                    // TODO: this causes 'access denied' errors, although not clear why
                    //commandLine.Add("/O"); // copy ownership and ACL
                    commandLine.Add("/B"); // copy symbolic link itself, not the target
                }
            }
            else
            {
                if (settings.Force)
                {
                    commandLine.Add("-f");
                }
                if (settings.Verbose)
                {
                    commandLine.Add("-v");
                }
                if (settings.Recursive)
                {
                    commandLine.Add("-R");
                }
                if (settings.PreserveAllAttributes)
                {
                    commandLine.Add("-a");
                }
            }
        }