Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Formula/spin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ def install
end

def post_install
# Migrate plugins and templates and templates data to new data directory
source_dir = "#{HOMEBREW_PREFIX}/etc/fermyon-spin"
dest_dir = "#{HOMEBREW_PREFIX}/etc/spinframework-spin"
if File.directory?(source_dir)
ohai "Migrating Spin data from #{source_dir} to #{dest_dir}"
mkdir_p dest_dir
Dir.glob("#{source_dir}/*").each do |file|
mv(file, dest_dir)
end
Dir.rmdir(source_dir) if Dir.empty?(source_dir) # Remove if empty
end

# Install default templates and plugins for language tooling and deploying apps to the cloud.
# Templates and plugins are installed into `pkgetc/"templates"` and `pkgetc/"plugins"`.
system "#{bin}/spin", "templates", "install", "--git", "https://github.com/fermyon/spin", "--upgrade"
Expand Down