21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/desktop/cli.rb', line 21
def set(path, already_failed = false)
osx = OSX.new(options)
image = HTTP.uri?(path) ? WebImage.new(path) : LocalImage.new(path)
begin
osx.desktop_image = image
rescue OSX::DesktopImagePermissionsError => e
fail_with_permissions_error if already_failed
print_permissions_message
osx.update_desktop_image_permissions
puts
set path, true
rescue OSX::DesktopImageMissingError
fail_with_missing_image_error image
end
end
|