-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ steps: | |
uses: actions/checkout@v3 | ||
|
||
- name: Setup dctl CLI | ||
uses: deployplex/[email protected].12 | ||
uses: deployplex/[email protected].13 | ||
with: | ||
token: ${{ secrets.DEPLOYPLEX_TOKEN }} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import click | ||
import os | ||
import webbrowser | ||
import configparser | ||
|
||
|
||
@click.group("open", help="Project open commands") | ||
def open(): | ||
pass | ||
|
||
|
||
@open.command(name="git", help="Open project git repository") | ||
def open_git(): | ||
git_config_path = os.path.join(os.getcwd(), '.git', 'config') | ||
|
||
if not os.path.exists(git_config_path): | ||
raise click.ClickException("No .git folder found.") | ||
|
||
config = configparser.ConfigParser() | ||
config.read(git_config_path) | ||
|
||
try: | ||
url = config.get('remote "origin"', 'url') | ||
if url.startswith("git@"): | ||
url = url.replace(":", "/").replace("git@", "https://").replace(".git", "") | ||
webbrowser.open(url) | ||
except configparser.NoSectionError: | ||
raise click.ClickException("Remote origin not found.") | ||
except Exception as e: | ||
raise click.ClickException(f"An error occurred: {e}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "dctl" | ||
version = "0.0.12" | ||
version = "0.0.13" | ||
description = "Command Line Interface (CLI) for DeployPlex" | ||
authors = ["Alvaro Molina <[email protected]>"] | ||
license = "Apache-2.0" | ||
|