Procházet zdrojové kódy

Fix bashscripts becoming executable without shebang

Don't forget the `endif`.
Weiyi Lou před 9 roky
rodič
revize
874c5c864f
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      vim/settings/templates.vim

+ 1 - 1
vim/settings/templates.vim

@@ -2,7 +2,7 @@
 " Removes comments, places cursor at end of file.
 autocmd BufNewFile *.sh silent 0r ~/dotfiles/vim/templates/bashscript | silent 2,$ g/^#/d | normal G
 " Make shell scripts executable on save.
-autocmd BufWritePost *.sh if getline(1) =~ "^#!/" | silent !chmod +x <afile>
+autocmd BufWritePost *.sh if getline(1) =~ "^#!/" | silent !chmod +x <afile> | endif
 
 " Template for makefiles.
 autocmd BufNewFile [Mm]akefile silent 0r ~/dotfiles/vim/templates/makefile | silent 4,$ g/^#/d | normal G