Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
enciyo committed Jun 9, 2024
1 parent bb7f414 commit f247c73
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion che.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=1.0.11
version=1.0.12
python=3.11
6 changes: 6 additions & 0 deletions che/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"port": 9696,
"debug": false,
"project_path": "/Users/mustafakilic/PycharmProjects/gh-che/che",
"listen_url": "https://api.githubcopilot.com/chat/completions"
}
22 changes: 19 additions & 3 deletions che/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@


def __author_name():
return subprocess.run(["git", "config", "user.name"], capture_output=True).stdout.decode("utf-8").strip()
path = os.path.join(get_config()["project_path"])
return subprocess.run(
f"cd {path} && git config user.name",
capture_output=True,
shell=True,
check=True
).stdout.decode("utf-8").strip()


def __current_branch():
return subprocess.run(["git", "branch", "--show-current"], capture_output=True).stdout.decode(
"utf-8").strip().replace("/", "-")
path = os.path.join(get_config()["project_path"])
return subprocess.run(
f"cd {path} && git branch --show-current",
shell=True,
check=True,
capture_output=True
).stdout.decode("utf-8").strip().replace("/", "-")


def create_or_open_file(file_path, mode):
Expand Down Expand Up @@ -87,3 +98,8 @@ def save_config(config):
config_path = os.path.join(os.path.dirname(__file__), "config.json")
with open(config_path, "w") as f:
json.dump(config, f, indent=2, default=str, ensure_ascii=False)


if __name__ == '__main__':
print(__current_branch())
print(__author_name())

0 comments on commit f247c73

Please sign in to comment.