diff --git a/translate b/translate index 5fcbcf0d073d82b32b29989a5ffdaaeaff857130..267e97f6d31df6475e31ed82cbe94c8a0a4682ac 100755 --- a/translate +++ b/translate @@ -36,11 +36,18 @@ language=( fr de es ) COMMAND_FILES=src/${PROJECT_NAME}* function install_i18next-conv { + SUDO='' + if [ -f /usr/bin/sudo ]; then + SUDO='sudo' + fi + if [ -f /usr/sbin/sudo ]; then + SUDO='sudo' + fi if [ ! -f /usr/bin/i18next-conv ]; then - sudo apt-get install -y curl npm - curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - - sudo apt-get install -y nodejs - sudo npm install i18next-conv -g + ${SUDO} apt-get install -y curl npm + curl -sL https://deb.nodesource.com/setup_0.12 | ${SUDO} bash - + ${SUDO} apt-get install -y nodejs + ${SUDO} npm install i18next-conv -g fi }