diff options
author | Ben S <ogham@bsago.me> | 2014-06-28 17:56:57 +0100 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2014-06-28 17:56:57 +0100 |
commit | 85e557a7443d74b878e0e81debb284bd112ba6bd (patch) | |
tree | 8d958e72ab21e1bf9f2b67a93310d1c19c477dc8 /src/filetype.rs | |
parent | 2fa954be20f28e6ad10d28c2571307fba6268b1d (diff) |
Highlight common build files
Diffstat (limited to 'src/filetype.rs')
-rw-r--r-- | src/filetype.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/filetype.rs b/src/filetype.rs index 894fb52..9ac3402 100644 --- a/src/filetype.rs +++ b/src/filetype.rs @@ -39,6 +39,11 @@ static CRYPTO_TYPES: &'static [&'static str] = &[ static COMPILED_TYPES: &'static [&'static str] = &[ "class", "elc", "hi", "o", "pyc" ]; + +static BUILD_TYPES: &'static [&'static str] = &[ + "Makefile", "Cargo.toml", "SConstruct", "CMakeLists.txt", + "build.gradle", "Rakefile", "Gruntfile.js", + "Gruntfile.coffee" ]; impl FileType { pub fn style(&self) -> Style { @@ -80,7 +85,7 @@ impl<'a> HasType for File<'a> { else if self.stat.perm.contains(io::UserExecute) { return Executable; } - else if self.name.starts_with("README") { + else if self.name.starts_with("README") || BUILD_TYPES.iter().any(|&s| s == self.name) { return Immediate; } else if self.ext.is_some() { |