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? } |
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
#!/usr/bin/env ruby | |
# Smarter be for ruby projects that prioritizes local project binstubs | |
# - uses zsh when needed, assuming MacOS Catalina or later | |
# - save on your path | |
# - drop the .rb | |
# - chmod +x | |
# - always type `be <command>` and the right thing should happen | |
# | |
# - inspired by Justin Searls (@searls) |