From 917bc48348406c07c07a008881330db4aee63fa7 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 6 Jan 2015 13:31:26 -0500 Subject: [PATCH] Use File.directory? to test for local directories Some of our submodules end in ".tmLanguage", which we used to think meant it was a file rather than a directory. --- script/convert-grammars | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/script/convert-grammars b/script/convert-grammars index e03acd71..5ed47a61 100755 --- a/script/convert-grammars +++ b/script/convert-grammars @@ -159,15 +159,14 @@ end def load_grammars(tmp_dir, source, all_scopes) is_url = source.start_with?("http:", "https:") return [] if is_url && !$options[:remote] - is_single_file = source.end_with?('.tmLanguage', '.plist') p = if !is_url - if is_single_file - SingleFile.new(source) - else + if File.directory?(source) DirectoryPackage.new(source) + else + SingleFile.new(source) end - elsif is_single_file + elsif source.end_with?('.tmLanguage', '.plist') SingleGrammar.new(source) elsif source.start_with?('https://github.com') GitHubPackage.new(source)