Skip to content

Commit 8763742

Browse files
build: Ignore --patch option for local sources
1 parent 866f53d commit 8763742

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/ruby_wasm/cli.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,16 @@ def compute_build_source(options)
180180
src_name = options[:ruby_version]
181181
aliases = self.class.build_source_aliases(root)
182182
source = aliases[src_name]
183-
if source.nil? && File.directory?(src_name)
184-
# Treat as a local source if the given name is a source directory.
185-
RubyWasm.logger.debug "Using local source: #{src_name}"
186-
source = { type: "local", path: src_name }
187-
end
188-
189183
if source.nil?
184+
if File.directory?(src_name)
185+
# Treat as a local source if the given name is a source directory.
186+
RubyWasm.logger.debug "Using local source: #{src_name}"
187+
if options[:patches]
188+
RubyWasm.logger.warn "Patches specified through --patch are ignored for local sources"
189+
end
190+
return { type: "local", path: src_name }
191+
end
192+
# Otherwise, it's an unknown source.
190193
raise(
191194
"Unknown Ruby source: #{src_name} (available: #{aliases.keys.join(", ")} or a local directory)"
192195
)

0 commit comments

Comments
 (0)