devtools-hub 2.7.0__tar.gz → 2.8.0__tar.gz
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.
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/PKG-INFO +1 -1
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub/cli.py +31 -4
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub.egg-info/PKG-INFO +1 -1
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/pyproject.toml +1 -1
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/setup.py +1 -1
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/README.md +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub/__init__.py +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub/scanner.py +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub/server.py +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub.egg-info/SOURCES.txt +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub.egg-info/dependency_links.txt +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub.egg-info/entry_points.txt +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub.egg-info/requires.txt +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/devtools_hub.egg-info/top_level.txt +0 -0
- {devtools_hub-2.7.0 → devtools_hub-2.8.0}/setup.cfg +0 -0
|
@@ -77,6 +77,7 @@ def main():
|
|
|
77
77
|
bench 性能测试
|
|
78
78
|
clean 清理缓存
|
|
79
79
|
update 检查更新
|
|
80
|
+
selfupdate 一键自更新
|
|
80
81
|
start 启动服务
|
|
81
82
|
stop 停止服务
|
|
82
83
|
""")
|
|
@@ -500,15 +501,41 @@ def main():
|
|
|
500
501
|
try:
|
|
501
502
|
latest = urllib.request.urlopen('https://pypi.org/pypi/devtools-hub/json', timeout=5)
|
|
502
503
|
data = json.loads(latest.read())
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
latest_version = data['info']['version']
|
|
505
|
+
current_version = '2.7.0'
|
|
506
|
+
print(f"当前版本: {current_version}")
|
|
507
|
+
print(f"PyPI 最新版本: {latest_version}")
|
|
508
|
+
if latest_version != current_version:
|
|
509
|
+
print(f"📦 发现新版本 {latest_version},正在更新...")
|
|
510
|
+
# 执行更新
|
|
511
|
+
result = subprocess.run([sys.executable, '-m', 'pip', 'install', '--upgrade', 'devtools-hub'],
|
|
512
|
+
capture_output=True, text=True)
|
|
513
|
+
if result.returncode == 0:
|
|
514
|
+
print("✅ 更新成功!")
|
|
515
|
+
print("💡 运行 'source ~/.zshrc' 使 PATH 生效")
|
|
516
|
+
else:
|
|
517
|
+
print(f"❌ 更新失败: {result.stderr}")
|
|
507
518
|
else:
|
|
508
519
|
print("✅ 已是最新版本")
|
|
509
520
|
except Exception as e:
|
|
510
521
|
print(f"❌ 检查失败: {e}")
|
|
511
522
|
|
|
523
|
+
elif cmd == "selfupdate":
|
|
524
|
+
"""自更新命令 - 一键更新自身"""
|
|
525
|
+
print("🔄 正在自更新 devtools-hub...")
|
|
526
|
+
try:
|
|
527
|
+
# 使用 pip 更新
|
|
528
|
+
result = subprocess.run([sys.executable, '-m', 'pip', 'install', '--upgrade', '--force-reinstall', 'devtools-hub'],
|
|
529
|
+
capture_output=True, text=True)
|
|
530
|
+
if result.returncode == 0:
|
|
531
|
+
print("✅ 自更新成功!")
|
|
532
|
+
print("💡 运行 'source ~/.zshrc' 使 PATH 生效")
|
|
533
|
+
else:
|
|
534
|
+
print(f"❌ 自更新失败:")
|
|
535
|
+
print(result.stderr)
|
|
536
|
+
except Exception as e:
|
|
537
|
+
print(f"❌ 自更新异常: {e}")
|
|
538
|
+
|
|
512
539
|
elif cmd == "start":
|
|
513
540
|
print("🚀 启动服务...")
|
|
514
541
|
subprocess.Popen([sys.executable, "-m", "devtools_hub.server"],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|