create-entity-server 0.3.0 → 0.3.1
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
|
@@ -160,6 +160,23 @@ _download() {
|
|
|
160
160
|
chmod +x "$dest"
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
_download_plain() {
|
|
164
|
+
local url="$1"
|
|
165
|
+
local dest="$2"
|
|
166
|
+
local tmp="${dest}.tmp"
|
|
167
|
+
|
|
168
|
+
if command -v curl >/dev/null 2>&1; then
|
|
169
|
+
curl -fsSL --retry 3 -o "$tmp" "$url"
|
|
170
|
+
elif command -v wget >/dev/null 2>&1; then
|
|
171
|
+
wget -q -O "$tmp" "$url"
|
|
172
|
+
else
|
|
173
|
+
echo "❌ curl 또는 wget 이 필요합니다."
|
|
174
|
+
exit 1
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
mv "$tmp" "$dest"
|
|
178
|
+
}
|
|
179
|
+
|
|
163
180
|
_install() {
|
|
164
181
|
local target_ver="${1#v}" # v 접두사 제거
|
|
165
182
|
local current_ver
|
|
@@ -203,17 +220,26 @@ _install_dist() {
|
|
|
203
220
|
local target_ver="$1"
|
|
204
221
|
local file="dist.tar.gz"
|
|
205
222
|
local url="https://github.com/${REPO}/releases/download/v${target_ver}/${file}"
|
|
223
|
+
local fallback_url="https://github.com/${REPO}/archive/refs/tags/v${target_ver}.tar.gz"
|
|
206
224
|
local tmp_tar="/tmp/entity-server-dist-${target_ver}.tar.gz"
|
|
207
225
|
local tmp_dir="/tmp/entity-server-dist-${target_ver}"
|
|
226
|
+
local downloaded_from="release asset"
|
|
208
227
|
|
|
209
228
|
printf " ↓ %-32s" "$file"
|
|
210
229
|
if ! _download "$url" "$tmp_tar" 2>/dev/null; then
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
230
|
+
if _download_plain "$fallback_url" "$tmp_tar" 2>/dev/null; then
|
|
231
|
+
downloaded_from="repository tag archive"
|
|
232
|
+
echo "✓ (fallback)"
|
|
233
|
+
else
|
|
234
|
+
echo "✗ 실패 (업데이트 스킵)"
|
|
235
|
+
echo " release asset: $url"
|
|
236
|
+
echo " fallback tag archive: $fallback_url"
|
|
237
|
+
echo " ⚠️ dist 패키지를 가져오지 못했습니다. 바이너리만 업데이트됨."
|
|
238
|
+
return 0
|
|
239
|
+
fi
|
|
240
|
+
else
|
|
241
|
+
echo "✓"
|
|
215
242
|
fi
|
|
216
|
-
echo "✓"
|
|
217
243
|
|
|
218
244
|
rm -rf "$tmp_dir"
|
|
219
245
|
mkdir -p "$tmp_dir"
|
|
@@ -238,6 +264,7 @@ _install_dist() {
|
|
|
238
264
|
fi
|
|
239
265
|
|
|
240
266
|
echo ""
|
|
267
|
+
echo " dist 소스: $downloaded_from"
|
|
241
268
|
echo " 파일 동기화 (configs/ entities/ 제외):"
|
|
242
269
|
for DIR in "${DIST_DIRS[@]}"; do
|
|
243
270
|
local src="${src_root}/${DIR}"
|