mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-11 04:53:51 -05:00
Embed plugin guards
This commit is contained in:
10
build
10
build
@@ -102,14 +102,16 @@ copy_file() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${file_path}"
|
mkdir -p "${file_path}"
|
||||||
touch "$file_in_dst"
|
|
||||||
|
|
||||||
# Use comma instead of / to handle cases like c/c++
|
(
|
||||||
if [[ "${package_name}" == "jsx" ]]; then
|
if [[ "${package_name}" == "jsx" ]]; then
|
||||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard_jsx.vim.template >> "$file_in_dst"
|
printf "if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n\n"
|
||||||
else
|
else
|
||||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
|
printf "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '$package_name') == -1\n\n"
|
||||||
fi
|
fi
|
||||||
|
cat "$file_in_tmp"
|
||||||
|
printf "\nendif\n"
|
||||||
|
) >> "$file_in_dst"
|
||||||
}
|
}
|
||||||
|
|
||||||
update_readme() {
|
update_readme() {
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '%%PACK%%') == -1
|
|
||||||
|
|
||||||
%%CONTENT%%
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
|
||||||
|
|
||||||
%%CONTENT%%
|
|
||||||
|
|
||||||
endif
|
|
||||||
Reference in New Issue
Block a user