Skip to content

Instantly share code, notes, and snippets.

@jeroenvisser101
Last active February 20, 2016 19:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenvisser101/a772e86565fd414b8cc5 to your computer and use it in GitHub Desktop.
Save jeroenvisser101/a772e86565fd414b8cc5 to your computer and use it in GitHub Desktop.
Copy Sketch templates from git repository to the Sketch template folder

Easily work with sketch templates on Git, by having a script that updates them from your repository

#!/usr/bin/env ruby
# script/sketch: Updates the sketch templates with the repo's templates.
TARGET_PATH = File.expand_path("~/Library/Application Support/com.bohemiancoding.sketch3/Templates")
Dir["./design/templates/*.sketch"].each do |file|
source = File.expand_path(file)
target = File.join(TARGET_PATH, File.basename(file))
File.delete(target) if File.exists?(source)
File.symlink(source, target)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment