spcd/cd/__init__.py

15 lines
330 B
Python
Raw Normal View History

2024-04-26 19:58:35 +00:00
import os
2024-04-26 21:55:20 +00:00
COMMANDS_PREFIX = 'cd-'
2024-04-26 21:58:06 +00:00
def cd_list_environment():
2024-04-26 22:06:41 +00:00
for variable, value in sorted(os.environ.items()):
print(variable, '=', value)
2024-04-26 21:55:20 +00:00
2024-04-26 19:58:35 +00:00
2024-04-26 21:24:46 +00:00
def install_commands(path):
user = '/usr/local/bin'
for command in ['list-environment']:
2024-04-26 21:55:20 +00:00
os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}'))