|
123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/bin/bash
-
- missingCommands=""
-
- npm --version > /dev/null 2>&1
-
- if [ $? -ne 0 ]; then
- missingCommands="- npm"
- fi
-
- xdg-open --version > /dev/null 2>&1
-
- if [ $? != 0 ]; then
- missingCommands="${missingCommands}\n- xdg-utils"
- fi
-
- curl --version > /dev/null 2>&1
-
- if [ $? != 0 ]; then
- missingCommands="${missingCommands}\n- curl"
- fi
-
- if [ "$missingCommands" != "" ]; then
- echo -e "You have to install the following commands before installing this extension:\n$missingCommands"
- exit 1
- fi
-
- which instant-markdown-d > /dev/null 2>&1
-
- if [ "$?" -ne 0 ]; then
- echo "This plugin needs you to install the following NPM package: https://www.npmjs.com/package/instant-markdown-d"
- echo "Please install it and restart this script to activate this plugin."
- exit 1
- fi
-
- echo "Activating Markdown support..."
-
- cat ~/.vimrc | sed "s/\" Plugin 'suan\/vim-instant-markdown'/Plugin 'suan\/vim-instant-markdown'/" > ~/.vimrc.tmp
- rm ~/.vimrc
- mv ~/.vimrc.tmp ~/.vimrc
- vim +PluginInstall +qall
-
- echo "Markdown support has been activated!"
- echo "If you like this plugin, don't forget to send your ♥ to its author: https://github.com/suan/vim-instant-markdown"
-
|