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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpush-tool
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Supercharged Git push tool with automatic GitHub repo creation and pushing
5
5
  Home-page: https://github.com/inevitablegs/gitpush
6
6
  Author: Ganesh Sonawane
@@ -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("⚠️ winget installation failed.")
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("⬇️ Downloading GitHub CLI installer...")
47
- url = "https://github.com/cli/cli/releases/latest/download/gh_2.46.0_windows_amd64.msi"
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
- urllib.request.urlretrieve(url, msi_path)
50
-
51
- print("🛠 Installing GitHub CLI...")
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
- os.remove(msi_path) # Clean up
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpush-tool
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Supercharged Git push tool with automatic GitHub repo creation and pushing
5
5
  Home-page: https://github.com/inevitablegs/gitpush
6
6
  Author: Ganesh Sonawane
@@ -6,7 +6,7 @@ long_description = (Path(__file__).parent / "LONG_DESCRIPTION.md").read_text(enc
6
6
 
7
7
  setup(
8
8
  name="gitpush-tool",
9
- version="0.2.7",
9
+ version="0.2.8",
10
10
  packages=find_packages(),
11
11
  install_requires=[],
12
12
  entry_points={
@@ -1 +0,0 @@
1
- __version__ = "0.2.7"
File without changes
File without changes
File without changes
File without changes