lib/slideshow/cli/commands/quick.rb in slideshow-2.1.0 vs lib/slideshow/cli/commands/quick.rb in slideshow-2.2.0

- old
+ new

@@ -47,15 +47,24 @@ ## todo rename to fetch_quick_pak?? ## share/use same code in fetch too?? def fetch_pak( shortcut ) - src = config.map_quick_shortcut( shortcut ) + sources = config.map_fetch_shortcut( shortcut ) - if src.nil? - puts "*** error: no mapping found for quick shortcut '#{shortcut}'." + if sources.empty? + puts "*** error: no mapping found for shortcut '#{shortcut}'." exit 2 end + + sources = sources.select { |s| s.include?('.txt.quick') || s.include?('.quick.txt') } + + if sources.empty? + puts "*** error: no quick mapping found for shortcut '#{shortcut}'." + exit 2 + end + + src = sources[0] puts " Mapping quick shortcut '#{shortcut}' to: #{src}" # src = 'http://github.com/geraldb/slideshow/raw/d98e5b02b87ee66485431b1bee8fb6378297bfe4/code/templates/fullerscreen.txt' \ No newline at end of file