summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhou Qiankang <wszqkzqk@qq.com>2025-08-14 14:07:05 +0800
committerDavid Faure <faure@kde.org>2025-08-30 09:56:53 +0000
commit2e9e6f77bf8256357a40aed660a68c2ff900e310 (patch)
tree5bfa6d630b20b3c29559a572501f96f239682172
parentbdd5f6b59186088eed763c13ce30c0a379adf565 (diff)
text/x-vala: add executable subclass and shebang magic supportHEADmaster
Detect Vala source files using common shebangs such as `#!/usr/bin/vala` and `#!/usr/bin/env vala`. Also subclass application/x-executable to reflect their potential use as executable scripts. Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
-rw-r--r--data/freedesktop.org.xml.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in
index a3055ff..ab739ed 100644
--- a/data/freedesktop.org.xml.in
+++ b/data/freedesktop.org.xml.in
@@ -7160,7 +7160,14 @@ command to generate the output files.
<mime-type type="text/x-vala">
<comment>Vala source code</comment>
<sub-class-of type="text/plain"/>
+ <sub-class-of type='application/x-executable'/>
<magic priority="10">
+ <match type="string" value="#!/bin/vala" offset="0"/>
+ <match type="string" value="#!/usr/bin/vala" offset="0"/>
+ <match type="string" value="#!/usr/bin/env vala" offset="0"/>
+ <match type="string" value="#!/usr/bin/env -S vala" offset="0"/>
+ <match type="string" value="#!/bin/env vala" offset="0"/>
+ <match type="string" value="#!/bin/env -S vala" offset="0"/>
<match type="string" value="//" offset="0"/>
<match type="string" value="/*" offset="0"/>
<match type="string" value="class" offset="0"/>