Fix FTP CLI command - correct method name and fix start/stop calls
This commit is contained in:
parent
b7eb603011
commit
e93716b5f7
@ -90,10 +90,10 @@ def ftp(host: str, port: int):
|
|||||||
|
|
||||||
# Add current directory as allowed directory
|
# Add current directory as allowed directory
|
||||||
current_dir = os.path.abspath('.')
|
current_dir = os.path.abspath('.')
|
||||||
ftp_manager.add_allowed_directory(current_dir)
|
ftp_manager.add_onboarded_directory(current_dir)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ftp_manager.start_server()
|
ftp_manager.start()
|
||||||
click.echo(f"FTP Server started on {host}:{port}")
|
click.echo(f"FTP Server started on {host}:{port}")
|
||||||
click.echo("Press Ctrl+C to stop")
|
click.echo("Press Ctrl+C to stop")
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ def ftp(host: str, port: int):
|
|||||||
import time
|
import time
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
ftp_manager.stop_server()
|
ftp_manager.stop()
|
||||||
click.echo("FTP Server stopped")
|
click.echo("FTP Server stopped")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user