mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2024-11-23 16:40:08 +00:00
!4609 【Sample】Asset流水线编译报错问题解决
Merge pull request !4609 from YangXin/master
This commit is contained in:
commit
fb19c799e1
@ -1,63 +1,62 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
# ----------------------------------------------------------------------------
|
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# you may not use this file except in compliance with the License.
|
||||||
# you may not use this file except in compliance with the License.
|
# You may obtain a copy of the License at
|
||||||
# You may obtain a copy of the License at
|
#
|
||||||
#
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
#
|
||||||
#
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# See the License for the specific language governing permissions and
|
||||||
# See the License for the specific language governing permissions and
|
# limitations under the License.
|
||||||
# limitations under the License.
|
# ----------------------------------------------------------------------------
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
# ----------------------------------------------------------------------------
|
# Hvigor startup script, version 1.0.0
|
||||||
# Hvigor startup script, version 1.0.0
|
#
|
||||||
#
|
# Required ENV vars:
|
||||||
# Required ENV vars:
|
# ------------------
|
||||||
# ------------------
|
# NODE_HOME - location of a Node home dir
|
||||||
# NODE_HOME - location of a Node home dir
|
# or
|
||||||
# or
|
# Add /usr/local/nodejs/bin to the PATH environment variable
|
||||||
# Add /usr/local/nodejs/bin to the PATH environment variable
|
# ----------------------------------------------------------------------------
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
HVIGOR_APP_HOME="`pwd -P`"
|
||||||
HVIGOR_APP_HOME="`pwd -P`"
|
HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js
|
||||||
HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js
|
warn() {
|
||||||
warn() {
|
echo ""
|
||||||
echo ""
|
echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
|
||||||
echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
|
}
|
||||||
}
|
|
||||||
|
error() {
|
||||||
error() {
|
echo ""
|
||||||
echo ""
|
echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
|
||||||
echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
|
}
|
||||||
}
|
|
||||||
|
fail() {
|
||||||
fail() {
|
error "$@"
|
||||||
error "$@"
|
exit 1
|
||||||
exit 1
|
}
|
||||||
}
|
|
||||||
|
# Determine node to start hvigor wrapper script
|
||||||
# Determine node to start hvigor wrapper script
|
if [ -n "${NODE_HOME}" ];then
|
||||||
if [ -n "${NODE_HOME}" ];then
|
EXECUTABLE_NODE="${NODE_HOME}/bin/node"
|
||||||
EXECUTABLE_NODE="${NODE_HOME}/bin/node"
|
if [ ! -x "$EXECUTABLE_NODE" ];then
|
||||||
if [ ! -x "$EXECUTABLE_NODE" ];then
|
fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed"
|
||||||
fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed"
|
fi
|
||||||
fi
|
else
|
||||||
else
|
EXECUTABLE_NODE="node"
|
||||||
EXECUTABLE_NODE="node"
|
which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path"
|
||||||
which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path"
|
fi
|
||||||
fi
|
|
||||||
|
# Check hvigor wrapper script
|
||||||
# Check hvigor wrapper script
|
if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then
|
||||||
if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then
|
fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}"
|
||||||
fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}"
|
fi
|
||||||
fi
|
|
||||||
|
# start hvigor-wrapper script
|
||||||
# start hvigor-wrapper script
|
exec "${EXECUTABLE_NODE}" \
|
||||||
exec "${EXECUTABLE_NODE}" \
|
"${HVIGOR_WRAPPER_SCRIPT}" "$@"
|
||||||
"${HVIGOR_WRAPPER_SCRIPT}" "$@"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user