gitpush-tool 0.2.5__tar.gz → 0.2.6__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.5/gitpush_tool.egg-info → gitpush_tool-0.2.6}/PKG-INFO +1 -1
- gitpush_tool-0.2.6/gitpush_tool/__init__.py +1 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/gitpush_tool/cli.py +58 -4
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6/gitpush_tool.egg-info}/PKG-INFO +1 -1
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/setup.py +1 -1
- gitpush_tool-0.2.5/gitpush_tool/__init__.py +0 -1
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/LICENSE +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/MANIFEST.in +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/README.md +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/gitpush_tool/__doc__.py +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/gitpush_tool.egg-info/SOURCES.txt +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/gitpush_tool.egg-info/dependency_links.txt +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/gitpush_tool.egg-info/entry_points.txt +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/gitpush_tool.egg-info/top_level.txt +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/pyproject.toml +0 -0
- {gitpush_tool-0.2.5 → gitpush_tool-0.2.6}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.6"
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import os
|
|
3
3
|
import argparse
|
|
4
4
|
import sys
|
|
5
5
|
import subprocess
|
|
6
6
|
from datetime import datetime
|
|
7
|
+
import os
|
|
8
|
+
import subprocess
|
|
9
|
+
import platform
|
|
10
|
+
import urllib.request
|
|
11
|
+
import tempfile
|
|
12
|
+
import shutil
|
|
7
13
|
|
|
8
14
|
def check_gh_installed():
|
|
9
|
-
"""Check if GitHub CLI is installed"""
|
|
10
15
|
try:
|
|
11
16
|
subprocess.run(["gh", "--version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
12
17
|
return True
|
|
13
|
-
except:
|
|
14
|
-
|
|
18
|
+
except FileNotFoundError:
|
|
19
|
+
if platform.system() == "Windows":
|
|
20
|
+
return install_gh_cli_windows()
|
|
21
|
+
elif platform.system() == "Darwin":
|
|
22
|
+
return subprocess.run(["brew", "install", "gh"], check=True)
|
|
23
|
+
elif platform.system() == "Linux":
|
|
24
|
+
return subprocess.run(["sudo", "apt", "install", "-y", "gh"], check=True)
|
|
25
|
+
else:
|
|
26
|
+
print("❌ Unsupported platform")
|
|
27
|
+
return False
|
|
28
|
+
|
|
15
29
|
|
|
16
30
|
def gh_authenticated():
|
|
17
31
|
"""Check if user is authenticated with GitHub CLI"""
|
|
@@ -175,6 +189,42 @@ def standard_git_push(commit_message, branch, remote, force=False, tags=False):
|
|
|
175
189
|
print(f"❌ Push failed: {e}")
|
|
176
190
|
return False
|
|
177
191
|
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def install_gh_cli_windows():
|
|
196
|
+
"""Install GitHub CLI on Windows using winget or direct download"""
|
|
197
|
+
print("📦 GitHub CLI not found. Attempting installation on Windows...")
|
|
198
|
+
|
|
199
|
+
# First, try using winget
|
|
200
|
+
try:
|
|
201
|
+
subprocess.run(["winget", "--version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
202
|
+
print("👉 Installing via winget...")
|
|
203
|
+
subprocess.run(["winget", "install", "--id", "GitHub.cli", "-e", "--silent"], check=True)
|
|
204
|
+
print("✅ GitHub CLI installed successfully via winget.")
|
|
205
|
+
return True
|
|
206
|
+
except Exception as e:
|
|
207
|
+
print("⚠️ winget not available or failed. Trying direct download...")
|
|
208
|
+
|
|
209
|
+
# Fallback: Direct download from GitHub
|
|
210
|
+
try:
|
|
211
|
+
print("⬇️ Downloading GitHub CLI installer...")
|
|
212
|
+
url = "https://github.com/cli/cli/releases/latest/download/gh_2.46.0_windows_amd64.msi"
|
|
213
|
+
temp_dir = tempfile.mkdtemp()
|
|
214
|
+
msi_path = os.path.join(temp_dir, "gh.msi")
|
|
215
|
+
urllib.request.urlretrieve(url, msi_path)
|
|
216
|
+
|
|
217
|
+
print("🛠 Installing GitHub CLI...")
|
|
218
|
+
subprocess.run(["msiexec", "/i", msi_path, "/quiet", "/norestart"], check=True)
|
|
219
|
+
|
|
220
|
+
shutil.rmtree(temp_dir) # clean up
|
|
221
|
+
print("✅ GitHub CLI installed successfully via MSI.")
|
|
222
|
+
return True
|
|
223
|
+
except Exception as e:
|
|
224
|
+
print(f"❌ Direct installation failed: {e}")
|
|
225
|
+
return False
|
|
226
|
+
|
|
227
|
+
|
|
178
228
|
def run():
|
|
179
229
|
parser = argparse.ArgumentParser(
|
|
180
230
|
description="🚀 Supercharged Git push tool with GitHub repo creation",
|
|
@@ -234,6 +284,10 @@ def run():
|
|
|
234
284
|
args.tags
|
|
235
285
|
):
|
|
236
286
|
sys.exit(1)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
237
291
|
|
|
238
292
|
if __name__ == "__main__":
|
|
239
293
|
run()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.5"
|
|
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
|