execute.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:treehugger 作者: timeoutdigital 项目源码 文件源码
def execute(args):
    command = args.command
    if command and command[0] == '--':
        command = command[1:]
    if not command:
        print('No command to execute provided', file=sys.stderr)
        raise SystemExit(1)

    if args.filename:
        data = yaml.load_file_or_die(args.filename)
        env_dict = EnvironmentDict.from_yaml_dict(data)
    else:
        data = load_user_data_as_yaml_or_die(args.ignoremissing)
        env_dict = EnvironmentDict.from_yaml_dict(data)
    unencrypted_env_dict = env_dict.decrypt_all_encrypted(plain=True)
    os.environ.update(unencrypted_env_dict)
    os.execlp(command[0], *command)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号