File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ module Cask
12
12
13
13
DEFAULT_API_FILENAME = "cask.jws.json"
14
14
15
+ sig { returns ( String ) }
16
+ def self . api_filename
17
+ return DEFAULT_API_FILENAME unless ENV . fetch ( "HOMEBREW_USE_INTERNAL_API" , false )
18
+
19
+ "cask.#{ SimulateSystem . current_tag } .jws.json"
20
+ end
21
+
15
22
private_class_method :cache
16
23
17
24
sig { params ( token : String ) . returns ( Hash ) }
@@ -41,12 +48,12 @@ def self.source_download(cask)
41
48
end
42
49
43
50
def self . cached_json_file_path
44
- HOMEBREW_CACHE_API /DEFAULT_API_FILENAME
51
+ HOMEBREW_CACHE_API /api_filename
45
52
end
46
53
47
54
sig { returns ( T ::Boolean ) }
48
55
def self . download_and_cache_data!
49
- json_casks , updated = Homebrew ::API . fetch_json_api_file DEFAULT_API_FILENAME
56
+ json_casks , updated = Homebrew ::API . fetch_json_api_file api_filename
50
57
51
58
cache [ "renames" ] = { }
52
59
cache [ "casks" ] = json_casks . to_h do |json_cask |
Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ module Formula
12
12
13
13
DEFAULT_API_FILENAME = "formula.jws.json"
14
14
15
+ sig { returns ( String ) }
16
+ def self . api_filename
17
+ return DEFAULT_API_FILENAME unless ENV . fetch ( "HOMEBREW_USE_INTERNAL_API" , false )
18
+
19
+ "internal/formula.#{ SimulateSystem . current_tag } .jws.json"
20
+ end
21
+
15
22
private_class_method :cache
16
23
17
24
sig { params ( name : String ) . returns ( T ::Hash [ String , T . untyped ] ) }
@@ -42,12 +49,12 @@ def self.source_download(formula)
42
49
43
50
sig { returns ( Pathname ) }
44
51
def self . cached_json_file_path
45
- HOMEBREW_CACHE_API /DEFAULT_API_FILENAME
52
+ HOMEBREW_CACHE_API /api_filename
46
53
end
47
54
48
55
sig { returns ( T ::Boolean ) }
49
56
def self . download_and_cache_data!
50
- json_formulae , updated = Homebrew ::API . fetch_json_api_file DEFAULT_API_FILENAME
57
+ json_formulae , updated = Homebrew ::API . fetch_json_api_file api_filename
51
58
52
59
cache [ "aliases" ] = { }
53
60
cache [ "renames" ] = { }
You can’t perform that action at this time.
0 commit comments