Skip to content

Commit

Permalink
cask2formula: fix commit ID detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed May 24, 2024
1 parent 5aad46b commit 3937bbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cask2formula
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ class CaskConverter
`git diff --name-only; git ls-files --others --exclude-standard`.split(/\s+/).each do |file|
if file != "homebrew-cask-fonts" then
shard_letter = File.basename(file).delete_prefix("font-")[0]
remote_dir = "homebrew-cask/blob/master/Casks/font/font-#{shard_letter}"
remote_source = "https://github.com/Homebrew/#{file.sub(/Formula/, remote_dir)}"
commit_id = `git -C homebrew-cask-fonts log -n 1 --pretty=format:%H -- #{file.sub(/Formula/, 'Casks')}`
remote_file = file.sub(/Formula/, "Casks/font/font-#{shard_letter}")
remote_source = "https://github.com/Homebrew/homebrew-cask/blob/master/#{remote_file}"
commit_id = `git -C homebrew-cask-fonts log -n 1 --pretty=format:%H -- #{remote_file}`
system 'git', 'add', file
system 'git', 'commit', '-m', "import #{remote_source} from #{commit_id}"
end
Expand Down

0 comments on commit 3937bbb

Please sign in to comment.