From 3937bbbf3af7483925211f04f1a62685b4deee1b Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 24 May 2024 05:47:17 +0100 Subject: [PATCH] cask2formula: fix commit ID detection --- cask2formula | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cask2formula b/cask2formula index ba1816cc25..1c5132fb5c 100755 --- a/cask2formula +++ b/cask2formula @@ -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