From dd143bcaaab34bab2ef84953c4a06a3c13cefed0 Mon Sep 17 00:00:00 2001 From: Daniel Loffgren Date: Thu, 20 Aug 2015 14:28:32 +0900 Subject: [PATCH] install.sh now works without bash, and preserves the trap functionality via exits --- install.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 252082a6..ca095896 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,11 @@ -#!/usr/bin/env bash +#!/bin/sh -set -e - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_DIR=$(dirname $0 || exit $?) +cd $SCRIPT_DIR || exit $? build_file=$SCRIPT_DIR/third_party/ycmd/build.py -if [[ ! -f "$build_file" ]]; then +if [ ! -f "$build_file" ]; then echo "File $build_file doesn't exist; you probably forgot to run:" printf "\n\tgit submodule update --init --recursive\n\n" exit 1 @@ -21,7 +20,7 @@ if command_exists python2; then PYTHON_BINARY=python2 fi -$PYTHON_BINARY "$build_file" "$@" +$PYTHON_BINARY "$build_file" "$@" || exit $? # Remove old YCM libs if present so that YCM can start. rm -f python/*ycm_core.* &> /dev/null