Skip to content

Commit

Permalink
Merge pull request #25 from elkinaguas/change-modules-architecture
Browse files Browse the repository at this point in the history
Change modules architecture
  • Loading branch information
elkinaguas authored Apr 25, 2024
2 parents f2ec173 + f771d24 commit 1023206
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-clir.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python package
name: Test Clir

on:
pull_request:
Expand Down
22 changes: 12 additions & 10 deletions clir/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import subprocess
from rich.prompt import Prompt
from clir.utils.objects import Command
from clir.utils.objects import CommandTable
from clir.command import Command
from clir.command import CommandTable

@click.group()
def cli():
Expand All @@ -23,17 +23,19 @@ def init():
os.makedirs(dir_path, exist_ok=True)

# Define the file path and name
file_path = os.path.join(dir_path, 'commands.json')
files = ['commands.json', 'credentials.json']

# Check if the file already exists
if not os.path.exists(file_path):
# Create the file
with open(file_path, 'w') as file:
file.write('{}')
for file in files:
file_path = os.path.join(dir_path, file)
if not os.path.exists(file_path):
# Create the file
with open(file_path, 'w') as file_object:
file_object.write('{}')

print(f'File "{file_path}" created successfully.')
else:
print(f'A clir environment already exists in "{dir_path}".')
print(f'File "{file_path}" created successfully.')
else:
print(f'A clir environment already exists in "{dir_path}".')

@cli.command(help="Save new command 💾")
@click.option('-c', '--command', help="Command to be saved", prompt=True)
Expand Down
File renamed without changes.
Empty file removed clir/utils/__init__.py
Empty file.
82 changes: 59 additions & 23 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ repository = "https://github.com/elkinaguas/clir"
"Bug Tracker" = "https://github.com/elkinaguas/clir/issues"

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
rich = "^13.5.2"
click = "^8.1.7"
rich-click = "^1.7.0"
textual = "^0.47.1"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 1023206

Please sign in to comment.