Created
November 17, 2024 22:34
-
-
Save infews/0348da6167efbe04ca8540c24933c48d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_paths = ArchivablePathname.from(Dir.glob(File.join(options[:source], "*"))) | |
Archiver.new(source_paths, destination) | |
.move_unless { |path| File.exist?(File.join(destination, path.archive_path)) } | |
.collect { |path| path.move = Prompts::ConfirmPrompt.ask(label: "File #{path.archive_path} exists. Overwrite?") } | |
.move_if { |path| path.move? } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's more context necessary (perhaps), but here's where this is going:
Allowing a Force flag logic path, and likely a STDOUT logger, will be pretty easy after this.