def _ensure_snapcraft_yaml(self): source = project_loader.get_snapcraft_yaml() destination = os.path.join(self._snap_dir, 'snap', 'snapcraft.yaml') with contextlib.suppress(FileNotFoundError): os.remove(destination) os.makedirs(os.path.dirname(destination), exist_ok=True) file_utils.link_or_copy(source, destination)
def _ensure_snapcraft_yaml(self): source = project_loader.get_snapcraft_yaml() destination = os.path.join(self._snap_dir, 'snap', 'snapcraft.yaml') with contextlib.suppress(FileNotFoundError): os.remove(destination) os.makedirs(os.path.dirname(destination), exist_ok=True) file_utils.link_or_copy(source, destination)
def _get_origin_data(origin_dir): origin_data = {} yaml_file = project_loader.get_snapcraft_yaml(base_dir=origin_dir) try: with open(yaml_file) as fp: origin_data = yaml.safe_load(fp) except ScannerError as e: raise errors.InvalidWikiEntryError(e) from e return origin_data
def _get_origin_data(origin_dir): origin_data = {} yaml_file = project_loader.get_snapcraft_yaml(base_dir=origin_dir) try: with open(yaml_file) as fp: origin_data = yaml.load(fp) except ScannerError as e: raise errors.InvalidWikiEntryError(e) from e return origin_data