Created
May 28, 2013 02:48
-
-
Save ywjno/5660233 to your computer and use it in GitHub Desktop.
get instelled package infomation form %SUBLIME_TEXT%/Data/Packages folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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