gitpush-tool 0.2.9__tar.gz → 0.2.10__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.9/gitpush_tool.egg-info → gitpush_tool-0.2.10}/PKG-INFO +1 -1
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/README.md +1 -17
- gitpush_tool-0.2.10/gitpush_tool/__init__.py +1 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/gitpush_tool/cli.py +43 -81
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10/gitpush_tool.egg-info}/PKG-INFO +1 -1
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/setup.py +1 -1
- gitpush_tool-0.2.9/gitpush_tool/__init__.py +0 -1
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/LICENSE +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/MANIFEST.in +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/gitpush_tool/__doc__.py +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/gitpush_tool.egg-info/SOURCES.txt +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/gitpush_tool.egg-info/dependency_links.txt +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/gitpush_tool.egg-info/entry_points.txt +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/gitpush_tool.egg-info/top_level.txt +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/pyproject.toml +0 -0
- {gitpush_tool-0.2.9 → gitpush_tool-0.2.10}/setup.cfg +0 -0
|
@@ -20,22 +20,6 @@ A supercharged Git CLI tool that simplifies repository creation and pushing with
|
|
|
20
20
|
pip install gitpush-tool
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
### Prerequisites
|
|
24
|
-
|
|
25
|
-
- GitHub CLI (gh)
|
|
26
|
-
- Git
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# Install GitHub CLI
|
|
30
|
-
# macOS
|
|
31
|
-
brew install gh
|
|
32
|
-
|
|
33
|
-
# Windows
|
|
34
|
-
winget install --id GitHub.cli
|
|
35
|
-
|
|
36
|
-
# Linux (Debian/Ubuntu)
|
|
37
|
-
sudo apt install gh
|
|
38
|
-
```
|
|
39
23
|
|
|
40
24
|
## Usage 🛠️
|
|
41
25
|
|
|
@@ -179,4 +163,4 @@ Contributions welcome! Please follow these steps:
|
|
|
179
163
|
|
|
180
164
|
MIT - See LICENSE for details.
|
|
181
165
|
|
|
182
|
-
<center>✨ <strong>Happy Coding!</strong> ✨</center>
|
|
166
|
+
<center>✨ <strong>Happy Coding!</strong> ✨</center>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.10"
|
|
@@ -4,98 +4,60 @@ import sys
|
|
|
4
4
|
import subprocess
|
|
5
5
|
import shutil
|
|
6
6
|
import platform
|
|
7
|
-
import urllib.request
|
|
8
|
-
import tempfile
|
|
9
|
-
import json
|
|
10
|
-
|
|
11
|
-
def install_gh_cli_windows():
|
|
12
|
-
"""Install GitHub CLI on Windows using winget or direct download"""
|
|
13
|
-
# Try winget first
|
|
14
|
-
if shutil.which("winget"):
|
|
15
|
-
try:
|
|
16
|
-
print("📦 Attempting to install GitHub CLI with winget...")
|
|
17
|
-
subprocess.run(["winget", "install", "--id", "GitHub.cli", "--source", "winget", "--silent"], check=True, capture_output=True)
|
|
18
|
-
print("✅ GitHub CLI installed successfully via winget.")
|
|
19
|
-
return True
|
|
20
|
-
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
21
|
-
print("⚠️ Winget installation failed. Falling back to direct download.")
|
|
22
|
-
|
|
23
|
-
# Fallback to direct download
|
|
24
|
-
try:
|
|
25
|
-
print("⬇️ Finding the latest GitHub CLI release for Windows...")
|
|
26
|
-
api_url = "https://api.github.com/repos/cli/cli/releases/latest"
|
|
27
|
-
with urllib.request.urlopen(api_url) as response:
|
|
28
|
-
data = json.loads(response.read().decode())
|
|
29
|
-
|
|
30
|
-
msi_url = next((asset["browser_download_url"] for asset in data.get("assets", []) if asset.get("name", "").endswith("_windows_amd64.msi")), None)
|
|
31
|
-
|
|
32
|
-
if not msi_url:
|
|
33
|
-
print("❌ Could not find a downloadable MSI file for the latest release.", file=sys.stderr)
|
|
34
|
-
return False
|
|
35
|
-
|
|
36
|
-
msi_path = os.path.join(tempfile.gettempdir(), "gh_installer.msi")
|
|
37
|
-
|
|
38
|
-
print(f"⬇️ Downloading GitHub CLI from: {msi_url}")
|
|
39
|
-
urllib.request.urlretrieve(msi_url, msi_path)
|
|
40
|
-
|
|
41
|
-
print("🛠️ Installing GitHub CLI...")
|
|
42
|
-
subprocess.run(["msiexec", "/i", msi_path, "/quiet", "/norestart"], check=True)
|
|
43
|
-
|
|
44
|
-
os.remove(msi_path)
|
|
45
|
-
print("✅ GitHub CLI installed successfully.")
|
|
46
|
-
return True
|
|
47
|
-
except Exception as e:
|
|
48
|
-
print(f"❌ Direct installation failed: {e}", file=sys.stderr)
|
|
49
|
-
return False
|
|
50
7
|
|
|
51
8
|
def check_gh_installed():
|
|
52
|
-
"""
|
|
9
|
+
"""
|
|
10
|
+
Checks if GitHub CLI is installed. If not, it provides a comprehensive list
|
|
11
|
+
of platform-specific installation commands and fallbacks.
|
|
12
|
+
"""
|
|
53
13
|
if shutil.which("gh"):
|
|
54
14
|
return True
|
|
55
15
|
|
|
56
|
-
print("
|
|
57
|
-
|
|
58
|
-
answer = input(" Would you like this tool to attempt an automatic installation? (y/n): ").lower().strip()
|
|
59
|
-
except (EOFError, KeyboardInterrupt):
|
|
60
|
-
print("\nInstallation cancelled.", file=sys.stderr)
|
|
61
|
-
return False
|
|
62
|
-
|
|
63
|
-
if answer != 'y':
|
|
64
|
-
print("➡️ Installation skipped. Please install 'gh' manually from https://cli.github.com/", file=sys.stderr)
|
|
65
|
-
return False
|
|
16
|
+
print("❌ Error: GitHub CLI (gh) is not installed or not in your system's PATH.", file=sys.stderr)
|
|
17
|
+
print(" The '--new-repo' feature requires the GitHub CLI for all repository operations.", file=sys.stderr)
|
|
66
18
|
|
|
67
|
-
print("\n📦 Attempting to install GitHub CLI...")
|
|
68
19
|
system = platform.system()
|
|
69
|
-
|
|
20
|
+
install_options = []
|
|
21
|
+
|
|
22
|
+
# --- Platform-specific detection with fallbacks ---
|
|
23
|
+
if system == "Windows":
|
|
24
|
+
print("\n➡️ For Windows, we recommend one of the following package managers:", file=sys.stderr)
|
|
25
|
+
if shutil.which("winget"):
|
|
26
|
+
install_options.append(("Winget (Recommended)", "winget install --id GitHub.cli --source winget"))
|
|
27
|
+
if shutil.which("scoop"):
|
|
28
|
+
install_options.append(("Scoop", "scoop install gh"))
|
|
29
|
+
if shutil.which("choco"):
|
|
30
|
+
install_options.append(("Chocolatey", "choco install gh"))
|
|
70
31
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
print(" Running: brew install gh")
|
|
76
|
-
subprocess.run(["brew", "install", "gh"], check=True)
|
|
77
|
-
installed = True
|
|
78
|
-
elif system == "Linux":
|
|
79
|
-
print(" Running: sudo apt update && sudo apt install -y gh")
|
|
80
|
-
subprocess.run(["sudo", "apt", "update"], check=True)
|
|
81
|
-
subprocess.run(["sudo", "apt", "install", "-y", "gh"], check=True)
|
|
82
|
-
installed = True
|
|
83
|
-
else:
|
|
84
|
-
print(f"❌ Automatic installation is not supported for your OS ({system}).", file=sys.stderr)
|
|
85
|
-
print(" Please install 'gh' manually from https://cli.github.com/", file=sys.stderr)
|
|
86
|
-
return False
|
|
32
|
+
elif system == "Darwin":
|
|
33
|
+
print("\n➡️ For macOS, we recommend using Homebrew:", file=sys.stderr)
|
|
34
|
+
if shutil.which("brew"):
|
|
35
|
+
install_options.append(("Homebrew (Recommended)", "brew install gh"))
|
|
87
36
|
|
|
88
|
-
|
|
89
|
-
print(
|
|
90
|
-
|
|
91
|
-
|
|
37
|
+
elif system == "Linux":
|
|
38
|
+
print("\n➡️ For Linux, we recommend one of the following package managers:", file=sys.stderr)
|
|
39
|
+
if shutil.which("apt") or shutil.which("apt-get"):
|
|
40
|
+
install_options.append(("Debian/Ubuntu/Mint", "sudo apt update && sudo apt install gh -y"))
|
|
41
|
+
if shutil.which("dnf"):
|
|
42
|
+
install_options.append(("Fedora/RHEL/CentOS", "sudo dnf install gh"))
|
|
43
|
+
if shutil.which("yum"):
|
|
44
|
+
install_options.append(("Older Fedora/RHEL/CentOS", "sudo yum install gh"))
|
|
45
|
+
if shutil.which("pacman"):
|
|
46
|
+
install_options.append(("Arch Linux", "sudo pacman -S github-cli"))
|
|
47
|
+
if shutil.which("zypper"):
|
|
48
|
+
install_options.append(("openSUSE", "sudo zypper install gh"))
|
|
92
49
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
print("
|
|
96
|
-
|
|
97
|
-
|
|
50
|
+
# --- Displaying the options and the ultimate fallback ---
|
|
51
|
+
if install_options:
|
|
52
|
+
print(" Please copy and run one of the commands below in your terminal:\n", file=sys.stderr)
|
|
53
|
+
for name, command in install_options:
|
|
54
|
+
print(f" # For {name}:\n {command}\n", file=sys.stderr)
|
|
98
55
|
|
|
56
|
+
print(" If none of the above are available on your system, please follow the", file=sys.stderr)
|
|
57
|
+
print(" official installation guide for more options (including manual download):", file=sys.stderr)
|
|
58
|
+
print(" https://github.com/cli/cli#installation\n", file=sys.stderr)
|
|
59
|
+
print("‼️ After installation, please open a NEW terminal and run your command again.", file=sys.stderr)
|
|
60
|
+
|
|
99
61
|
return False
|
|
100
62
|
|
|
101
63
|
def gh_authenticated():
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.9"
|
|
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
|