linting
This commit is contained in:
parent
3b66390840
commit
371d66cb61
2 changed files with 6 additions and 7 deletions
|
@ -83,7 +83,7 @@ def cat(file: str) -> None:
|
|||
shut(file)
|
||||
|
||||
|
||||
def install_commands(path) -> None:
|
||||
def install_commands(path: str) -> None:
|
||||
step("Install commands")
|
||||
user = Path("/usr/local/bin")
|
||||
for command in [
|
||||
|
@ -94,7 +94,7 @@ def install_commands(path) -> None:
|
|||
"synchronize",
|
||||
]:
|
||||
print(command)
|
||||
os.symlink(path, user / f"{COMMANDS_PREFIX}{command}")
|
||||
(user / f"{COMMANDS_PREFIX}{command}").symlink_to(path)
|
||||
|
||||
|
||||
def set_ssh(*arguments) -> None:
|
||||
|
|
|
@ -6,12 +6,11 @@ from pathlib import Path
|
|||
import cd
|
||||
|
||||
if __name__ == "__main__":
|
||||
command, *arguments = sys.argv
|
||||
command = Path(command).name
|
||||
if command == "__main__.py":
|
||||
path, *arguments = sys.argv
|
||||
name = Path(path).name
|
||||
if name == "__main__.py":
|
||||
cd.set_ssh(*arguments)
|
||||
cd.install_commands(__file__)
|
||||
else:
|
||||
command = command.replace("-", "_")
|
||||
function = getattr(cd, command)
|
||||
function = getattr(cd, name.replace("-", "_"))
|
||||
function(*arguments)
|
||||
|
|
Loading…
Reference in a new issue