xref: /Lucene/lucene/distribution/src/binary-release/bin/luke.sh (revision 1089b482fc9d4b4202ca27e096723d0060446b51)
1d973e50cSUwe Schindler#!/bin/sh
2627ef4d4SDawid Weiss
3627ef4d4SDawid Weiss#  Licensed to the Apache Software Foundation (ASF) under one or more
4627ef4d4SDawid Weiss#  contributor license agreements.  See the NOTICE file distributed with
5627ef4d4SDawid Weiss#  this work for additional information regarding copyright ownership.
6627ef4d4SDawid Weiss#  The ASF licenses this file to You under the Apache License, Version 2.0
7627ef4d4SDawid Weiss#  the "License"); you may not use this file except in compliance with
8627ef4d4SDawid Weiss#  the License.  You may obtain a copy of the License at
9627ef4d4SDawid Weiss#
10627ef4d4SDawid Weiss#      http://www.apache.org/licenses/LICENSE-2.0
11627ef4d4SDawid Weiss#
12627ef4d4SDawid Weiss#  Unless required by applicable law or agreed to in writing, software
13627ef4d4SDawid Weiss#  distributed under the License is distributed on an "AS IS" BASIS,
14627ef4d4SDawid Weiss#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15627ef4d4SDawid Weiss#  See the License for the specific language governing permissions and
16627ef4d4SDawid Weiss#  limitations under the License.
17627ef4d4SDawid Weiss
18d973e50cSUwe SchindlerMODULES=`dirname "$0"`/..
19d973e50cSUwe SchindlerMODULES=`cd "$MODULES" && pwd`
2081ab1e59SDawid Weiss
2181ab1e59SDawid Weiss# check for overridden launch command (for use in integration tests), otherwise
2281ab1e59SDawid Weiss# use the default.
2381ab1e59SDawid Weissif [ -z "$LAUNCH_CMD" ]; then
2481ab1e59SDawid Weiss  LAUNCH_CMD=java
2581ab1e59SDawid Weiss  LAUNCH_OPTS=
2681ab1e59SDawid Weisselse
2781ab1e59SDawid Weiss  # We are integration-testing. Force UTF-8 as the encoding.
2881ab1e59SDawid Weiss  LAUNCH_OPTS=-Dfile.encoding=UTF-8
29*1089b482SRobert Muir  # check if Xvfb is available
30*1089b482SRobert Muir  if command -v xvfb-run > /dev/null 2>&1; then
31*1089b482SRobert Muir    LAUNCH_OPTS="$LAUNCH_CMD $LAUNCH_OPTS"
32*1089b482SRobert Muir    LAUNCH_CMD="xvfb-run"
33*1089b482SRobert Muir  fi
3481ab1e59SDawid Weissfi
3581ab1e59SDawid Weiss
3681ab1e59SDawid Weiss"$LAUNCH_CMD" $LAUNCH_OPTS --module-path "$MODULES/modules:$MODULES/modules-thirdparty" --module org.apache.lucene.luke "$@"
3772ba7ae2SDawid Weissexit $?
38