mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
596 B
23 lines
596 B
2 years ago
|
import os
|
||
|
|
||
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||
|
|
||
|
|
||
|
def install_or_update_builtin_applets():
|
||
|
from terminal.models import Applet
|
||
|
|
||
|
applets = os.listdir(BASE_DIR)
|
||
|
for d in applets:
|
||
|
path = os.path.join(BASE_DIR, d)
|
||
|
if not os.path.isdir(path) or not os.path.exists(os.path.join(path, 'manifest.yml')):
|
||
|
continue
|
||
|
print("Install or update applet: {}".format(path))
|
||
|
try:
|
||
|
Applet.install_from_dir(path)
|
||
|
except Exception as e:
|
||
|
print(e)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
install_or_update_builtin_applets()
|