mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 15:28:26 +01:00
Verify output refactoring. Attempt 2
This commit is contained in:
@@ -65,7 +65,7 @@ class CmdImportFile(CmdBase):
|
||||
|
||||
@staticmethod
|
||||
def verify_output(output, input):
|
||||
if len(output) > 0 and output[-1] == os.path.sep and not os.path.isdir(output):
|
||||
if output.is_dir_path(output) and not os.path.isdir(output):
|
||||
raise ImportFileError(u'Import error: output directory {} does not exist'.format(output))
|
||||
|
||||
if len(input) > 1 and not os.path.isdir(output):
|
||||
@@ -73,6 +73,10 @@ class CmdImportFile(CmdBase):
|
||||
raise ImportFileError(msg.format(output))
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def is_dir_path(self, output):
|
||||
return len(output) > 0 and output[-1] == os.path.sep
|
||||
|
||||
def import_and_commit_if_needed(self, input, output, lock=False, check_if_ready=True):
|
||||
if check_if_ready and not self.no_git_actions and not self.git.is_ready_to_go():
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user