1import os
2import subprocess
3
4def clone_repository(branch, commit_hash):
5    repository_url = "https://gitee.com/phytium_embedded/phytium-standalone-sdk.git"
6    target_folder =  "../libraries/phytium_standalone_sdk"
7
8    # Clone the repository
9    subprocess.call(["git", "clone", "-b", branch, repository_url, target_folder])
10
11    # Change to the cloned repository folder
12    os.chdir(target_folder)
13
14    # Checkout the specific commit
15    subprocess.call(["git", "checkout", commit_hash])
16
17    print("Repository cloned successfully to {}".format(os.getcwd()))
18
19if __name__ == "__main__":
20
21    branch_to_clone = "master"
22    commit_to_clone = "20d40083fb3b1b328a2b750938123999d6c12262"
23
24    clone_repository(branch_to_clone, commit_to_clone)
25