Created
November 16, 2021 12:21
-
-
Save yakumo-proj/e56cbb0445365e6c187cdebdd3a44a82 to your computer and use it in GitHub Desktop.
VRoidカスタムアイテムインストーラ
This file contains 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
require 'json' | |
require 'fileutils' | |
base_dir = Dir.home + '/Library/Containers/net.pixiv.vroid.macosx/Data' + | |
'/Library/Application Support/net.pixiv.vroid.macosx/custom_items/' | |
folders = readlines.map(&:chomp).map {|filename| | |
j = `unzip -p #{filename} v1customitem/meta.json` | |
objs = JSON.parse(j) | |
dest_path = base_dir + 'N00-' + objs['rootTransferableGroupTypeId'].split('.').last | |
FileUtils.mkdir_p(dest_path) | |
FileUtils.move(filename, dest_path) | |
dest_path | |
}.uniq | |
puts folders.empty? ? base_dir : folders |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment