mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user