Skip to content

Commit

Permalink
Merge pull request #2 from cafkafk/pr-1221
Browse files Browse the repository at this point in the history
(exa PR) 1221: add icon support for .mjs, .cjs, .mts, .cts files
  • Loading branch information
cafkafk authored Jul 30, 2023
2 parents 40ed085 + df5a101 commit 3221236
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/info/filetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ impl FileExtensions {
"Makefile", "Cargo.toml", "SConstruct", "CMakeLists.txt",
"build.gradle", "pom.xml", "Rakefile", "package.json", "Gruntfile.js",
"Gruntfile.coffee", "BUILD", "BUILD.bazel", "WORKSPACE", "build.xml", "Podfile",
"webpack.config.js", "meson.build", "composer.json", "RoboFile.php", "PKGBUILD",
"Justfile", "Procfile", "Dockerfile", "Earthfile", "Containerfile", "Vagrantfile", "Brewfile",
"Gemfile", "Pipfile", "build.sbt", "mix.exs", "bsconfig.json", "tsconfig.json",
"webpack.config.js", "webpack.config.cjs", "meson.build", "composer.json", "RoboFile.php",
"PKGBUILD", "Justfile", "Procfile", "Dockerfile", "Earthfile", "Containerfile", "Vagrantfile",
"Brewfile", "Gemfile", "Pipfile", "build.sbt", "mix.exs", "bsconfig.json", "tsconfig.json",
])
}

Expand Down
2 changes: 2 additions & 0 deletions src/info/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ impl<'a> File<'a> {
match &ext[..] {
"css" => vec![self.path.with_extension("sass"), self.path.with_extension("scss"), // SASS, SCSS
self.path.with_extension("styl"), self.path.with_extension("less")], // Stylus, Less
"mjs" => vec![self.path.with_extension("mts")], // JavaScript ES Modules source
"cjs" => vec![self.path.with_extension("cts")], // JavaScript Commonjs Modules source
"js" => vec![self.path.with_extension("coffee"), self.path.with_extension("ts")], // CoffeeScript, TypeScript

"aux" | // TeX: auxiliary file
Expand Down
3 changes: 3 additions & 0 deletions src/output/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ pub fn icon_for_file(file: &File<'_>) -> char {
"cab" => '\u{e70f}', // 
"cc" => '\u{e61d}', // 
"cfg" => '\u{e615}', // 
"cjs" => '\u{e74e}', // 
"class" => '\u{e256}', // 
"clj" => '\u{e768}', // 
"cljs" => '\u{e76a}', // 
Expand All @@ -152,6 +153,7 @@ pub fn icon_for_file(file: &File<'_>) -> char {
"css" => '\u{e749}', // 
"csv" => '\u{f1c3}', // 
"csx" => '\u{f031b}', // 󰌛
"cts" => '\u{e628}', // 
"cxx" => '\u{e61d}', // 
"d" => '\u{e7af}', // 
"dart" => '\u{e798}', // 
Expand Down Expand Up @@ -266,6 +268,7 @@ pub fn icon_for_file(file: &File<'_>) -> char {
"mp3" => '\u{f001}', // 
"mp4" => '\u{f03d}', // 
"msi" => '\u{e70f}', // 
"mts" => '\u{e628}', // 
"mustache" => '\u{e60f}', // 
"nix" => '\u{f313}', // 
"node" => '\u{f0399}', // 󰎙
Expand Down

0 comments on commit 3221236

Please sign in to comment.