Skip to content

Commit

Permalink
chore: change wordings
Browse files Browse the repository at this point in the history
  • Loading branch information
Caceresenzo committed Mar 28, 2023
1 parent d17e348 commit dc29176
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crunch_cli/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'crunch-cli'
__description__ = 'crunch-cli - CLI of the CrunchDAO Platform'
__version__ = '0.6.0b'
__version__ = '0.6.1b'
__author__ = 'Enzo CACERES'
__author_email__ = '[email protected]'
__url__ = 'https://github.com/crunchdao/crunch-cli'
6 changes: 3 additions & 3 deletions crunch_cli/command/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_data_urls(


def _download(url: str, path: str, force: bool):
logging.info(f"download %s from %s", path, cut_url(url))
print(f"download {path} from {cut_url(url)}")

with requests.get(url, stream=True) as response:
response.raise_for_status()
Expand All @@ -75,12 +75,12 @@ def _download(url: str, path: str, force: bool):
exists = os.path.exists(path)
if not force and exists:
if file_length is None:
logging.info(f"already exists: skip since unknown size")
print(f"already exists: skip since unknown size")
return

stat = os.stat(path)
if stat.st_size == file_length:
logging.info(f"already exists: file length match")
print(f"already exists: file length match")
return

with open(path, 'wb') as fd, tqdm.tqdm(total=file_length, unit='iB', unit_scale=True, leave=False) as progress:
Expand Down
6 changes: 1 addition & 5 deletions crunch_cli/command/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,4 @@ def push(
}
).json()

print("\n---")
print(f"version #{version['number']} uploaded!")

url = session.format_web_url(f"/project/versions/{version['number']}")
print(f"check your version: {url}")
return version
15 changes: 11 additions & 4 deletions crunch_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,28 @@ def setup(
command.download(session, force=True)

print("\n---")
print(f"your project in the directory `{directory}`:")
print(f" - cd {directory}")
print(f" - crunch --help")
print(f"Success! Your environment has been correctly setup.")
print(f"Next recommended actions:")
print(f" - To get inside your workspace directory, run: cd {directory}")
print(f" - To see all of the available commands of the CrunchDAO CLI, run: crunch --help")


@cli.command(help="Send the new version of your code.")
@click.option("-m", "--message", prompt=True, default="", help="Specify the change of your code. (like a commit message)")
def push(
message: str
):
command.push(
version = command.push(
session,
message=message
)

print("\n---")
print(f"Version #{version['number']} succesfully uploaded!")

url = session.format_web_url(f"/project/versions/{version['number']}")
print(f"Find it on your dashboard: {url}")


@cli.command(help="Test your code locally.")
@click.option("-m", "--main-file", default="main.py", show_default=True, help="Entrypoint of your code.")
Expand Down

0 comments on commit dc29176

Please sign in to comment.