#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import shutil
import sys
import os
import yaml

from os import path
from pathlib import Path

def get_config(action_dir):
	config_file_path = action_dir + "/config.yml"
	config_content = open(config_file_path, 'r').read()
	config = yaml.load(config_content, Loader=yaml.SafeLoader)

	return config

def main():
    # Path to current working directory
    curr_dir = os.path.dirname(os.path.realpath(__file__))
    config = get_config(curr_dir)
    source_file = config['extra_vars']['source_file']
    destination_file = config['extra_vars']['destination_file']
    repo_local_dir = os.environ["GIT_MANAGER_CURR_REPO"]
    
    # If the destination file is in a file path
    # Create the file path in the repo, if it doesn't exist
    if destination_file.rfind("/") != -1:
        destination_path = destination_file[0:destination_file.rfind("/")]
        Path(path.join(repo_local_dir, destination_path)).mkdir(parents=True, exist_ok=True)

    shutil.copy2(source_file, path.join(repo_local_dir, destination_file))

if __name__ == "__main__":
	main()
1eaf1cc78589cf2002670ed4daae0bb3036ce893
<mask token>


def get_config(action_dir):
    config_file_path = action_dir + '/config.yml'
    config_content = open(config_file_path, 'r').read()
    config = yaml.load(config_content, Loader=yaml.SafeLoader)
    return config


<mask token>

<mask token>


def get_config(action_dir):
    config_file_path = action_dir + '/config.yml'
    config_content = open(config_file_path, 'r').read()
    config = yaml.load(config_content, Loader=yaml.SafeLoader)
    return config


def main():
    curr_dir = os.path.dirname(os.path.realpath(__file__))
    config = get_config(curr_dir)
    source_file = config['extra_vars']['source_file']
    destination_file = config['extra_vars']['destination_file']
    repo_local_dir = os.environ['GIT_MANAGER_CURR_REPO']
    if destination_file.rfind('/') != -1:
        destination_path = destination_file[0:destination_file.rfind('/')]
        Path(path.join(repo_local_dir, destination_path)).mkdir(parents=
            True, exist_ok=True)
    shutil.copy2(source_file, path.join(repo_local_dir, destination_file))


<mask token>

<mask token>


def get_config(action_dir):
    config_file_path = action_dir + '/config.yml'
    config_content = open(config_file_path, 'r').read()
    config = yaml.load(config_content, Loader=yaml.SafeLoader)
    return config


def main():
    curr_dir = os.path.dirname(os.path.realpath(__file__))
    config = get_config(curr_dir)
    source_file = config['extra_vars']['source_file']
    destination_file = config['extra_vars']['destination_file']
    repo_local_dir = os.environ['GIT_MANAGER_CURR_REPO']
    if destination_file.rfind('/') != -1:
        destination_path = destination_file[0:destination_file.rfind('/')]
        Path(path.join(repo_local_dir, destination_path)).mkdir(parents=
            True, exist_ok=True)
    shutil.copy2(source_file, path.join(repo_local_dir, destination_file))


if __name__ == '__main__':
    main()

import shutil
import sys
import os
import yaml
from os import path
from pathlib import Path


def get_config(action_dir):
    config_file_path = action_dir + '/config.yml'
    config_content = open(config_file_path, 'r').read()
    config = yaml.load(config_content, Loader=yaml.SafeLoader)
    return config


def main():
    curr_dir = os.path.dirname(os.path.realpath(__file__))
    config = get_config(curr_dir)
    source_file = config['extra_vars']['source_file']
    destination_file = config['extra_vars']['destination_file']
    repo_local_dir = os.environ['GIT_MANAGER_CURR_REPO']
    if destination_file.rfind('/') != -1:
        destination_path = destination_file[0:destination_file.rfind('/')]
        Path(path.join(repo_local_dir, destination_path)).mkdir(parents=
            True, exist_ok=True)
    shutil.copy2(source_file, path.join(repo_local_dir, destination_file))


if __name__ == '__main__':
    main()

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import shutil
import sys
import os
import yaml

from os import path
from pathlib import Path

def get_config(action_dir):
	config_file_path = action_dir + "/config.yml"
	config_content = open(config_file_path, 'r').read()
	config = yaml.load(config_content, Loader=yaml.SafeLoader)

	return config

def main():
    # Path to current working directory
    curr_dir = os.path.dirname(os.path.realpath(__file__))
    config = get_config(curr_dir)
    source_file = config['extra_vars']['source_file']
    destination_file = config['extra_vars']['destination_file']
    repo_local_dir = os.environ["GIT_MANAGER_CURR_REPO"]
    
    # If the destination file is in a file path
    # Create the file path in the repo, if it doesn't exist
    if destination_file.rfind("/") != -1:
        destination_path = destination_file[0:destination_file.rfind("/")]
        Path(path.join(repo_local_dir, destination_path)).mkdir(parents=True, exist_ok=True)

    shutil.copy2(source_file, path.join(repo_local_dir, destination_file))

if __name__ == "__main__":
	main()