コード例 #1
0
ファイル: packager.py プロジェクト: confpack/confpacker
  def copy_files_to_build_dir(self, package, out_dir):
    data_dir = os.path.join(out_dir, "data")
    for local_path, target_path in package.files:
      path_in_data_dir = os.path.join(data_dir, target_path)
      parent_directory = os.path.dirname(path_in_data_dir)
      mkdir_p(parent_directory)

      shutil.copy2(local_path, path_in_data_dir)
コード例 #2
0
ファイル: packager.py プロジェクト: confpack/confpacker
  def copy_templates_to_build_dir(self, package, out_dir):
    data_dir = os.path.join(out_dir, "data")
    for local_path, target_path in package.templates:
      path_in_data_dir = os.path.join(data_dir, target_path)
      open(path_in_data_dir, "w").close()  # create empty file

      path_in_data_dir = os.path.join(data_dir, "etc", "confpack", "templates", package.name, target_path)
      parent_directory = os.path.dirname(path_in_data_dir)
      mkdir_p(parent_directory)

      shutil.copy2(local_path, path_in_data_dir)