Skip to content

Commit c312cbc

Browse files
Build with the submodule version Sizzle if it exists; otherwise build from the default Sizzle in src/sizzle.js. (We still won't initiate a fetch of the Sizzle submodule, so if the user wants this behavior he/she should grab the submodule manually.) [#1249 state:resolved]
1 parent fe31e6b commit c312cbc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Rakefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,19 @@ EOF
157157
end
158158

159159
def self.get_selector_engine(name)
160-
return if name == DEFAULT_SELECTOR_ENGINE || !name
160+
return if !name
161+
# If the submodule exists, we should use it, even if we're using the
162+
# default engine; the user might have fetched it manually, and thus would
163+
# want to build a distributable with the most recent version of that
164+
# engine.
161165
submodule_path = File.join(ROOT_DIR, "vendor", name)
162166
return submodule_path if File.exist?(File.join(submodule_path, "repository", ".git"))
163167
return submodule_path if name === "legacy_selector"
168+
169+
# If it doesn't exist, we should fetch it, _unless_ it's the default
170+
# engine. We've already got a known version of the default engine in our
171+
# load path.
172+
return if name == DEFAULT_SELECTOR_ENGINE
164173
get_submodule('the required selector engine', "#{name}/repository")
165174
unless File.exist?(submodule_path)
166175
puts "The selector engine you required isn't available at vendor/#{name}.\n\n"

0 commit comments

Comments
 (0)