Skip to content

Commit

Permalink
Merge pull request #7 from GussSoares/fix/cli/noancii-encode
Browse files Browse the repository at this point in the history
[fix] no ancii characters now is supported
  • Loading branch information
GussSoares authored Oct 14, 2021
2 parents 71b8aad + 60d28d6 commit e06ee66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions triggercmd_cli/command/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
https://github.com/GussSoares/triggercmd-cli
"""

import os
import subprocess
import time
from pathlib import Path

import typer
from rich.console import Console
Expand Down Expand Up @@ -126,6 +123,7 @@ def test(trigger: str = typer.Option("", help="Trigger name")):

@command_app.command(help="Download and install TriggerCMD Agent")
def install():
# TODO: precisa instalar dentro do /usr/share
console.rule("Installing")
try:
TriggerCMDAgent.clone()
Expand Down
6 changes: 3 additions & 3 deletions triggercmd_cli/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@


def load_json_file(path: Union[Path, str] = constants.COMMAND_FILE_PATH) -> List[dict]:
with open(path) as json_file:
with open(path, encoding="utf-8") as json_file:
return json.load(json_file)


def update_json_file(data: List[dict]):
with open(constants.COMMAND_FILE_PATH, "w+") as json_file:
json_file.write(json.dumps(data, indent=4, sort_keys=True))
with open(constants.COMMAND_FILE_PATH, "w+", encoding="utf-8") as json_file:
json_file.write(json.dumps(data, indent=4, sort_keys=True, ensure_ascii=False))


def get_command_titles():
Expand Down

0 comments on commit e06ee66

Please sign in to comment.