예제 #1
0
        public ICommandResult Execute(CommandContext context)
        {
            IOperationSource source = context.GetOperationSource(stage, stashes);

            if (source.IsNullOrEmpty())
            {
                return(new TextResult("The stage is empty."));
            }

            return(Zip(new ZipContext
            {
                Items = source.GetPaths(),
                DestinationZipFile = context.GetTargetFile(),
                SourceLobby = source.GetLobby(),
                Flat = context.HasOption(ApplyOptions.FLATTEN) || !source.HasLobby(),
                Override = context.HasOption(ApplyOptions.OVERWRITE),
                Add = context.HasOption(ApplyOptions.ADD)
            }));
        }
예제 #2
0
        public ICommandResult Execute(CommandContext context)
        {
            IOperationSource source = context.GetOperationSource(stage, stashes);

            if (source.IsNullOrEmpty())
            {
                return(new TextResult("The stage is empty."));
            }

            CopyContext copyContext = new CopyContext
            {
                Items       = source.GetPaths(),
                Destination = context.GetTargetDirectory(),
                SourceLobby = source.GetLobby(),
                Flat        = context.HasOption(ApplyOptions.FLATTEN) || !source.HasLobby(),
                Overwrite   = context.HasOption(ApplyOptions.OVERWRITE),
                Preview     = context.HasOption(ApplyOptions.PREVIEW)
            };

            return(Copy(copyContext));
        }