forked from Ameba-AIoT/ameba-rtos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathameba.py
More file actions
38 lines (27 loc) · 781 Bytes
/
ameba.py
File metadata and controls
38 lines (27 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2025 Realtek Semiconductor Corp.
# SPDX-License-Identifier: Apache-2.0
#
# Ameba SDK CLI development tool
import sys
import os
current_script_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(f'{current_script_path}/tools/scripts')
from ameba_manager import AmebaManager
def main():
manager = AmebaManager()
manager.cmd_preprocess()
args = sys.argv[1:]
if not args:
command = "build"
else:
command = args[0].lower()
args = args[1:] if len(args) > 1 else []
success = False
handler = manager.get_command_handler(command)
if handler:
success = handler(args)
sys.exit(0 if success else 1)
if __name__ == "__main__":
main()