@@ -77,6 +77,11 @@ def create_repository_metadata(row, singular_field_names, repeating_field_names)
77
77
78
78
79
79
def find_files (row_filepath , row_first_filepath , base_filepath ):
80
+ if row_filepath is '' :
81
+ # We will interpret this as "No files to load or update"
82
+ print ("row_filepath is None" )
83
+ return None , None
84
+
80
85
filepath = os .path .join (base_filepath , row_filepath )
81
86
if not os .path .exists (filepath ):
82
87
raise FileNotFoundError (filepath )
@@ -111,13 +116,16 @@ def repo_import(repo_metadata_filepath, title, first_file, other_files, reposito
111
116
# rake gwss:ingest_etd -- --manifest='path-to-manifest-json-file' --primaryfile='path-to-primary-attachment-file/myfile.pdf' --otherfiles='path-to-all-other-attachments-folder'
112
117
command = ingest_command .split (' ' ) + ['--' ,
113
118
'--manifest=%s' % repo_metadata_filepath ,
114
- '--primaryfile=%s' % first_file ,
115
119
'--depositor=%s' % ingest_depositor ]
120
+ if first_file :
121
+ command .extend (['--primaryfile=%s' % first_file ])
116
122
if other_files :
117
123
command .extend (['--otherfiles=%s' % ',' .join (other_files )])
118
124
if repository_id :
119
125
log .info ('%s is an update.' , title )
120
126
command .extend (['--update-item-id=%s' % repository_id ])
127
+ if first_file is None :
128
+ command .extend (['--skip-file-updates' ])
121
129
log .info ("Command is: %s" % ' ' .join (command ))
122
130
output = subprocess .check_output (command , cwd = ingest_path )
123
131
repository_id = output .decode ('utf-8' ).rstrip ('\n ' )
0 commit comments