forked from JohnCoates/CSSketch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupSymlinks.rb
34 lines (26 loc) · 991 Bytes
/
setupSymlinks.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/ruby
# Setup Symlinks for easy development debugging
require 'fileutils'
require 'open3'
projectDirectory = File.expand_path(File.dirname(__FILE__) + "/../")
plugin = projectDirectory + "/CSSketch.sketchplugin"
frameworkPlugin = projectDirectory + "/External/SketchKit/SketchKit.sketchplugin"
pluginsFolder = File.expand_path("~/Library/Application Support/com.bohemiancoding.sketch3/Plugins")
pluginDestination = pluginsFolder + "/CSSketch.sketchplugin"
if File.exists?(pluginDestination) == true
FileUtils.rm_r(pluginDestination)
end
if File.symlink(plugin, pluginDestination) == false
puts "Failed to make plugin symlink!"
exit 1
end
puts "Made plugin symlink."
frameworkDestination = pluginsFolder + "/SketchKit.sketchplugin"
if File.exists?(frameworkDestination) == true
FileUtils.rm_r(frameworkDestination)
end
if File.symlink(frameworkPlugin, frameworkDestination) == false
puts "Failed to make framework symlink!"
exit 1
end
puts "Made framework symlink."