Skip to content

Instantly share code, notes, and snippets.

@ywjno
Created May 28, 2013 02:48
Show Gist options
  • Save ywjno/5660233 to your computer and use it in GitHub Desktop.
Save ywjno/5660233 to your computer and use it in GitHub Desktop.
get instelled package infomation form %SUBLIME_TEXT%/Data/Packages folder
# encoding: utf-8
require "find"
require 'json'
jsons = []
Dir.foreach(Dir.pwd) do |dir|
real_path = File.expand_path dir
unless real_path == Dir.pwd
if File.exist?(real_path + '/package-metadata.json')
jsons << JSON.load(File.read(real_path + '/package-metadata.json')).merge(name: dir)
end
end
end
File.open(File.expand_path(Dir.pwd + '/package-metadatas.json'), 'w') do |file|
JSON.dump(jsons, file)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment