File tree Expand file tree Collapse file tree 2 files changed +17
-21
lines changed Expand file tree Collapse file tree 2 files changed +17
-21
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,7 @@ end_of_line = lf
7
7
[* .lua ]
8
8
indent_style = space
9
9
indent_size = 2
10
+
11
+ [* .sh ]
12
+ indent_style = space
13
+ indent_size = 2
Original file line number Diff line number Diff line change 4
4
# $VIMRUNTIME specifies neovim runtime path, defaults to "/usr/share/nvim/runtime" if unset.
5
5
6
6
if [ -z " ${VIMRUNTIME} " ]; then
7
- export VIMRUNTIME=" /usr/share/nvim/runtime"
7
+ export VIMRUNTIME=" /usr/share/nvim/runtime"
8
8
fi
9
9
10
10
exit_value=0
11
- in_section=false
12
11
13
- while IFS= read -r line; do
14
- if [[ $line =~ ^local\ icons_by_file_extension\ = \ \{ $ ]]; then
15
- in_section=true
16
- elif [[ $line =~ ^\} $ ]]; then
17
- in_section=false
18
- fi
12
+ while read -r key; do
13
+ # Search for the key in the main file
14
+ line=$( grep -F " \" $key \" " " lua/nvim-web-devicons.lua" )
15
+ if [ -z " $line " ]; then
16
+ [ -f " ${VIMRUNTIME} /syntax/$key .vim" ] &&
17
+ echo -e " \e[33mPlease add \" $key \" to filetypes Lua table.\e[0m" &&
18
+ exit_value=1
19
+ fi
20
+ done < <(
21
+ awk ' /^local icons_by_file_extension /{flag=1; next} /^}/{flag=0} flag' lua/nvim-web-devicons/icons-default.lua |
22
+ sed -r ' s|.*\["(.*)"\].*|\1|'
23
+ )
19
24
20
- if $in_section && [[ $line =~ \[\" (.+)\"\] ]]; then
21
- key=" ${BASH_REMATCH[1]} "
22
- # Search for the key in the main file
23
- line=$( grep -F " \" $key \" " " lua/nvim-web-devicons.lua" )
24
- if [ -n " $line " ]; then
25
- continue
26
- else
27
- [ -f " ${VIMRUNTIME} /syntax/$key .vim" ] &&
28
- echo -e " \e[33mPlease add \" $key \" to filetypes Lua table.\e[0m" &&
29
- exit_value=1
30
- fi
31
- fi
32
- done < " lua/nvim-web-devicons/icons-default.lua"
33
25
exit $exit_value
You can’t perform that action at this time.
0 commit comments