Sha256: fd656e0f5dd9cb7b010969fc53d1d5ae6dec834620b6f090870dc2299600a070

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

#! /usr/bin/env ruby

$LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))

require 'optparse'
require 'photoapp'

options = {}

OptionParser.new do |opts|
  opts.on("-c", "--config PATH", String, "Path to config file") do |config|
    options['config'] = config
  end
end.parse!

if ARGV.first == 'setup'
  ARGV.shift
  if `brew list imagemagick` =~ /Error:/
    system "brew update && brew install imagemagick"
  end

  unless `ls /Library/Automator` =~ /Import Files into Photos/
    system "say 'please install Automator actions for Photos app'"
    system "open #{Photoapp.gem_dir('assets/photos-action-installer.pkg')}"
  end

  system "ln -s #{Photoapp.gem_dir('assets/Reprint.app')} /Applications/"
  system "ln -s #{Photoapp.gem_dir('assets/photoapp-process.workflow')} #{File.expand_path("~/Library/Workflows/Applications/Folder\\ Actions/")}"
  system "open /System/Library/CoreServices/Folder\\ Actions\\ Setup.app"
  system "open /System/Library/Image\\ Capture/Support/Application/AutoImporter.app"
else

  if ARGV.first == 'process'
    ARGV.shift
    options['source'] = ARGV.shift
    Photoapp::Session.new(options).process
  elsif ARGV.first == 'upload'
    Photoapp::Session.new(options).upload
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
desoto-photoapp-0.1.9 exe/photoapp