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)
评论列表
文章目录