Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically create missing package repository dir #623

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/rezplugins/package_repository/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os.path
import os
import stat
import errno
import time

from rez.package_repository import PackageRepository
Expand Down Expand Up @@ -583,9 +584,15 @@ def install_variant(self, variant_resource, dry_run=False, overrides=None):

# check repo exists on disk
path = self.location
if not os.path.exists(path):
raise PackageRepositoryError(
"Package repository path does not exist: %s" % path)

try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise PackageRepositoryError(
"Package repository did not exist "
"and could not be created."
)

# install the variant
def _create_variant():
Expand Down