setupvars.sh: Updated logic for detecting INSTALLDIR - using relative path every time instead of checking <INSTALLDIR> or INTEL_OPENVINO_DIR (#1536)

This commit is contained in:
Artyom Anokhov 2020-07-29 18:23:36 +03:00 committed by GitHub
parent f34511642a
commit 2b1fc60435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,17 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
INSTALLDIR="${INTEL_OPENVINO_DIR:-<INSTALLDIR>}"
if [[ ! -d "${INSTALLDIR}" ]]; then
# Script has not been processed by installer, so INSTALLDIR is not valid
# Using autodetection assuming:
# - current shell is "bash"
# - location of the current script is in "INSTALLDIR/bin"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BASE_DIR="$( dirname "$SCRIPT_DIR" )"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BASE_DIR="$( dirname "$SCRIPT_DIR" )"
INSTALLDIR="${BASE_DIR}"
INSTALLDIR="${BASE_DIR}"
fi
export INTEL_OPENVINO_DIR="$INSTALLDIR"
export INTEL_CVSDK_DIR="$INTEL_OPENVINO_DIR"