Skip to content

Commit 5cfe26f

Browse files
committed
book: avoid filenames with colons and/or question marks
We just fixed the checkout on Windows by renaming files whose names contain colons or question marks. Let's prevent those filenames (which are invalid on Windows) from being re-generated in the future. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d4acdc8 commit 5cfe26f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script/book.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def next_section_url
374374
def save
375375
return if self.slug.nil?
376376

377-
path = self.absolute_path(self.slug)
377+
path = self.absolute_path(self.slug.gsub(/[:?]/, ''))
378378
FileUtils.mkdir_p(File.dirname(path))
379379
File.open("#{path}.html", 'w') do |file|
380380
file.write(@chapter.wrap_front_matter(self.front_matter))

0 commit comments

Comments
 (0)