Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -404,6 +404,8 @@ async def join(websocket, key):
|
|
404 |
# Register to receive moves from this game.
|
405 |
connected.add(websocket)
|
406 |
try:
|
|
|
|
|
407 |
process = await asyncio.create_subprocess_shell(
|
408 |
'ls',
|
409 |
# cwd=base_path,
|
@@ -417,8 +419,8 @@ async def join(websocket, key):
|
|
417 |
project_name.append(line.strip().decode('utf-8'))
|
418 |
|
419 |
return_code = await process.wait()
|
420 |
-
|
421 |
-
|
422 |
# Send the first move, in case the first player already played it.
|
423 |
file_structure = await generate_file_structure(base_path)
|
424 |
# Receive and process moves from the second player.
|
|
|
404 |
# Register to receive moves from this game.
|
405 |
connected.add(websocket)
|
406 |
try:
|
407 |
+
base_path = os.path.join(os.getcwd(), 'projects', key)
|
408 |
+
mod_command = f'cd {base_path} && ls'
|
409 |
process = await asyncio.create_subprocess_shell(
|
410 |
'ls',
|
411 |
# cwd=base_path,
|
|
|
419 |
project_name.append(line.strip().decode('utf-8'))
|
420 |
|
421 |
return_code = await process.wait()
|
422 |
+
|
423 |
+
current_directory = f'projects/{key}/{project_name[0]}'
|
424 |
# Send the first move, in case the first player already played it.
|
425 |
file_structure = await generate_file_structure(base_path)
|
426 |
# Receive and process moves from the second player.
|