Skip to content

Commit feb2e02

Browse files
🐛 fix: Fixed path conflict for create-file. Bug resolved.
1 parent f841bb7 commit feb2e02

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

squarecloud/cli/app.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ async def get_app_status(ctx: Context):
8888

8989
table = Table(title='Status', header_style='purple')
9090

91-
status_list = [
92-
attr for attr in dir(status) if not attr.startswith('__')
93-
]
91+
status_list = status.__slots__
9492
for s in status_list:
9593
table.add_column(s.capitalize(), justify='center')
9694
table.add_row(
@@ -160,7 +158,7 @@ async def app_data(ctx: Context):
160158
data: AppData = await client.app_data(app_id)
161159
table = Table(title='Status', header_style='purple')
162160

163-
status_list = data.model_dump(exclude_none=True)
161+
status_list = data.__slots__
164162
for s in status_list:
165163
table.add_column(s.capitalize(), justify='center')
166164
table.add_row(

squarecloud/cli/files.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import io
2+
import os
23
from io import BytesIO
34

45
import click
@@ -156,11 +157,12 @@ async def file_delete(ctx: Context, path: str):
156157
@click.pass_context
157158
@run_async
158159
async def file_create(ctx: Context, file: io.BufferedReader, path: str):
160+
name = os.path.basename(file.name)
159161
client: Client = ctx.obj['client']
160162
app_id = ctx.obj['app_id']
161-
full_path = path + file.name
163+
full_path = path + name
162164
if path != '/':
163-
full_path = f'/{path}/{file.name}'
165+
full_path = f'/{path}/{name}'
164166
with Console().status('loading'):
165167
response: Response = await client.create_app_file(
166168
app_id,

0 commit comments

Comments
 (0)