language/python: move rewrite_python_shebang to compat
This commit is contained in:
parent
3955e7e13b
commit
32ab83d055
@ -1,5 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "compat/cask/dsl/version"
|
||||
require "compat/language/python"
|
||||
require "compat/requirements/macos_requirement"
|
||||
require "compat/formula"
|
||||
|
||||
17
Library/Homebrew/compat/language/python.rb
Normal file
17
Library/Homebrew/compat/language/python.rb
Normal file
@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Language
|
||||
module Python
|
||||
class << self
|
||||
module Compat
|
||||
def rewrite_python_shebang(python_path)
|
||||
Pathname.pwd.find do |f|
|
||||
Utils::Shebang.rewrite_shebang(Shebang.python_shebang_rewrite_info(python_path), f)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
prepend Compat
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -87,10 +87,6 @@ module Language
|
||||
]
|
||||
end
|
||||
|
||||
def self.rewrite_python_shebang(python_path)
|
||||
Pathname.pwd.find { |f| Utils::Shebang.rewrite_shebang(Shebang.python_shebang_rewrite_info(python_path), f) }
|
||||
end
|
||||
|
||||
# Mixin module for {Formula} adding shebang rewrite features.
|
||||
module Shebang
|
||||
module_function
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user