forked from eclipse-che/che-theia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·37 lines (30 loc) · 1.01 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
#
# Copyright (c) 2018 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
base_dir=$(cd "$(dirname "$0")"; pwd)
. "${base_dir}"/../build.include
DIR=$(cd "$(dirname "$0")"; pwd)
LOCAL_ASSEMBLY_DIR="${DIR}"/generator
if [ -d "${LOCAL_ASSEMBLY_DIR}" ]; then
rm -r "${LOCAL_ASSEMBLY_DIR}"
fi
#in mac os 'cp' cannot create destination dir, so create it first
mkdir ${LOCAL_ASSEMBLY_DIR}
FILE="${base_dir}"/../../generator/eclipse-che-theia-generator.tgz
if [ -f "$FILE" ]; then
cp "${FILE}" "${LOCAL_ASSEMBLY_DIR}"
else
echo "$FILE does not exist, trying to generate..."
(cd "${base_dir}"/../../generator/ && yarn prepare && yarn pack --filename eclipse-che-theia-generator.tgz)
cp "${FILE}" "${LOCAL_ASSEMBLY_DIR}"
fi
init --name:theia-dev "$@"
build
if ! skip_tests; then
bash "${base_dir}"/e2e/build.sh "$@"
fi