gitpush-tool 0.2.7__tar.gz → 0.2.8__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.
- {gitpush_tool-0.2.7/gitpush_tool.egg-info → gitpush_tool-0.2.8}/PKG-INFO +1 -1
- gitpush_tool-0.2.8/gitpush_tool/__init__.py +1 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/gitpush_tool/cli.py +38 -9
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8/gitpush_tool.egg-info}/PKG-INFO +1 -1
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/setup.py +1 -1
- gitpush_tool-0.2.7/gitpush_tool/__init__.py +0 -1
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/LICENSE +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/MANIFEST.in +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/README.md +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/gitpush_tool/__doc__.py +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/gitpush_tool.egg-info/SOURCES.txt +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/gitpush_tool.egg-info/dependency_links.txt +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/gitpush_tool.egg-info/entry_points.txt +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/gitpush_tool.egg-info/top_level.txt +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/pyproject.toml +0 -0
- {gitpush_tool-0.2.7 → gitpush_tool-0.2.8}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.8"
|
|
@@ -31,26 +31,55 @@ def check_gh_installed():
|
|
|
31
31
|
print(f"❌ Failed to install GitHub CLI: {e}")
|
|
32
32
|
return False
|
|
33
33
|
|
|
34
|
+
import os
|
|
35
|
+
import subprocess
|
|
36
|
+
import shutil
|
|
37
|
+
import tempfile
|
|
38
|
+
import urllib.request
|
|
39
|
+
import json
|
|
40
|
+
|
|
34
41
|
def install_gh_cli_windows():
|
|
35
42
|
"""Install GitHub CLI on Windows using winget or direct download"""
|
|
36
43
|
# Try winget first
|
|
37
44
|
if shutil.which("winget"):
|
|
38
45
|
try:
|
|
46
|
+
print("📦 Attempting to install GitHub CLI with winget...")
|
|
39
47
|
subprocess.run(["winget", "install", "--id", "GitHub.cli", "--silent"], check=True)
|
|
48
|
+
print("✅ GitHub CLI installed successfully via winget.")
|
|
40
49
|
return True
|
|
41
|
-
except subprocess.CalledProcessError:
|
|
42
|
-
print("⚠️
|
|
43
|
-
|
|
50
|
+
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
51
|
+
print("⚠️ Winget installation failed. Falling back to direct download.")
|
|
52
|
+
|
|
44
53
|
# Fallback to direct download
|
|
45
54
|
try:
|
|
46
|
-
print("⬇️
|
|
47
|
-
|
|
55
|
+
print("⬇️ Finding the latest GitHub CLI release for Windows...")
|
|
56
|
+
api_url = "https://api.github.com/repos/cli/cli/releases/latest"
|
|
57
|
+
with urllib.request.urlopen(api_url) as response:
|
|
58
|
+
data = json.loads(response.read().decode())
|
|
59
|
+
|
|
60
|
+
# Find the correct MSI asset
|
|
61
|
+
msi_url = None
|
|
62
|
+
for asset in data.get("assets", []):
|
|
63
|
+
if asset.get("name", "").endswith("_windows_amd64.msi"):
|
|
64
|
+
msi_url = asset.get("browser_download_url")
|
|
65
|
+
break
|
|
66
|
+
|
|
67
|
+
if not msi_url:
|
|
68
|
+
print("❌ Could not find a downloadable MSI file for the latest release.")
|
|
69
|
+
return False
|
|
70
|
+
|
|
48
71
|
msi_path = os.path.join(tempfile.gettempdir(), "gh_installer.msi")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
72
|
+
|
|
73
|
+
print(f"⬇️ Downloading GitHub CLI from: {msi_url}")
|
|
74
|
+
urllib.request.urlretrieve(msi_url, msi_path)
|
|
75
|
+
|
|
76
|
+
print("🛠️ Installing GitHub CLI...")
|
|
77
|
+
# Use msiexec for silent installation
|
|
52
78
|
subprocess.run(["msiexec", "/i", msi_path, "/quiet", "/norestart"], check=True)
|
|
53
|
-
|
|
79
|
+
|
|
80
|
+
# Clean up the downloaded file
|
|
81
|
+
os.remove(msi_path)
|
|
82
|
+
print("✅ GitHub CLI installed successfully.")
|
|
54
83
|
return True
|
|
55
84
|
except Exception as e:
|
|
56
85
|
print(f"❌ Direct installation failed: {e}")
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.7"
|
|
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
|