Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add icon support for .mjs, .cjs, .mts, .cts files #1221

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/info/filetype.rs
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", "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", "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
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
Expand Up @@ -130,6 +130,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 @@ -147,6 +148,7 @@ pub fn icon_for_file(file: &File<'_>) -> char {
"css" => '\u{e749}', // 
"csv" => '\u{f1c3}', // 
"csx" => '\u{f81a}', // 
"cts" => '\u{e628}', // 
"cxx" => '\u{e61d}', // 
"d" => '\u{e7af}', // 
"dart" => '\u{e798}', // 
Expand Down Expand Up @@ -258,6 +260,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{f898}', // 
Expand Down