dashboard-shell-shell 3.0.5-test.44 → 3.0.5-test.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/scripts/build-pkg.sh
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
4
4
|
BASE_DIR="$( cd $SCRIPT_DIR && cd ../.. & pwd)"
|
|
5
|
-
SHELL_DIR=$BASE_DIR/shell/
|
|
6
5
|
EXIT_CODE=0
|
|
7
6
|
FORMATS="umd-min"
|
|
8
7
|
|
|
@@ -19,12 +18,18 @@ done
|
|
|
19
18
|
|
|
20
19
|
shift $((OPTIND-1))
|
|
21
20
|
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
SHELL_DIR=$
|
|
21
|
+
# ---- 修改这里 ----
|
|
22
|
+
# 优先使用顶级 shell 文件夹,如果不存在则使用 node_modules/dashboard-shell-shell
|
|
23
|
+
SHELL_DIR=$BASE_DIR/shell/
|
|
24
|
+
if [ ! -d "${SHELL_DIR}" ]; then
|
|
25
|
+
SHELL_DIR=$BASE_DIR/node_modules/dashboard-shell-shell/
|
|
26
|
+
if [ ! -d "${SHELL_DIR}" ]; then
|
|
27
|
+
echo "Error: dashboard-shell-shell not found in node_modules"
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
27
30
|
fi
|
|
31
|
+
# 转为绝对路径,防止符号链接循环
|
|
32
|
+
SHELL_DIR=$(cd -P "${SHELL_DIR}" && pwd)
|
|
28
33
|
|
|
29
34
|
CREATE_TARBALL=${2}
|
|
30
35
|
|
|
@@ -46,18 +51,14 @@ if [ -d "${BASE_DIR}/pkg/${1}" ]; then
|
|
|
46
51
|
|
|
47
52
|
pushd pkg/${1}
|
|
48
53
|
|
|
49
|
-
#
|
|
50
|
-
if [ -e ".shell" ]; then
|
|
51
|
-
|
|
52
|
-
if [ "${LINK}" != "${SHELL_DIR}" ]; then
|
|
53
|
-
echo ".shell symlink exists but does not point to expected location - please check and fix"
|
|
54
|
-
popd
|
|
55
|
-
exit -1
|
|
56
|
-
fi
|
|
57
|
-
else
|
|
58
|
-
ln -s ${SHELL_DIR} .shell
|
|
54
|
+
# 删除旧的 .shell,防止循环
|
|
55
|
+
if [ -L ".shell" ] || [ -e ".shell" ]; then
|
|
56
|
+
rm -rf .shell
|
|
59
57
|
fi
|
|
60
58
|
|
|
59
|
+
# 创建新的符号链接
|
|
60
|
+
ln -s "${SHELL_DIR}" .shell
|
|
61
|
+
|
|
61
62
|
FILE=index.js
|
|
62
63
|
if [ -f ./index.ts ]; then
|
|
63
64
|
FILE=index.ts
|
|
@@ -72,7 +73,7 @@ if [ -d "${BASE_DIR}/pkg/${1}" ]; then
|
|
|
72
73
|
cp -f ./package.json ${PKG_DIST}/package.json
|
|
73
74
|
node ${SCRIPT_DIR}/pkgfile.js ${PKG_DIST}/package.json
|
|
74
75
|
rm -rf ${PKG_DIST}/*.bak
|
|
75
|
-
rm .shell
|
|
76
|
+
rm -rf .shell
|
|
76
77
|
|
|
77
78
|
popd
|
|
78
79
|
fi
|
|
@@ -81,22 +82,16 @@ if [ $EXIT_CODE -ne 0 ]; then
|
|
|
81
82
|
exit $EXIT_CODE
|
|
82
83
|
fi
|
|
83
84
|
|
|
84
|
-
|
|
85
85
|
if [ -n "${CREATE_TARBALL}" ]; then
|
|
86
86
|
echo $COMMIT $COMMIT_BRANCH > ${PKG_DIST}/version-commit.txt
|
|
87
87
|
|
|
88
88
|
TARBALL=${NAME}.tar.gz
|
|
89
89
|
|
|
90
90
|
pushd ${PKG_DIST}
|
|
91
|
-
|
|
92
91
|
rm -f ../$TARBALL
|
|
93
|
-
|
|
94
92
|
echo "Compressing to ${TARBALL}..."
|
|
95
|
-
|
|
96
93
|
tar -czf ../${TARBALL} .
|
|
97
|
-
|
|
98
94
|
popd
|
|
99
|
-
|
|
100
95
|
fi
|
|
101
96
|
|
|
102
97
|
exit $EXIT_CODE
|