parent
539df80b93
commit
e27f66e569
2 changed files with 8 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
|
||||
|
||||
def install_commands():
|
||||
os.symlink(__file__, '/usr/local/bin/cd-list-environment')
|
||||
def install_commands(path):
|
||||
user = '/usr/local/bin'
|
||||
for command in ['list-environment']:
|
||||
os.symlink(path, os.path.join(user, f'cd-{command}')
|
||||
|
|
|
@ -8,7 +8,8 @@ import cd
|
|||
|
||||
if __name__ == '__main__':
|
||||
command, *_ = sys.argv
|
||||
print(command)
|
||||
command = os.path.basename(command)
|
||||
if command == '__main__.py':
|
||||
cd.install_commands(__file__)
|
||||
else:
|
||||
print(command)
|
||||
cd.install_commands()
|
||||
|
|
Loading…
Reference in a new issue