Skip to content

Commit 01443b4

Browse files
authored
fix(loader): treat root_folder props set to blank as nil (#89)
1 parent 25d2e4d commit 01443b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/placeos-frontend-loader/loader.cr

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ module PlaceOS::FrontendLoader
200200

201201
# check for any relevant changes
202202
rebuild_cache, old_folder_name = check_for_changes(repository)
203+
Log.trace { {message: "check_for_changes", rebuild_cache: rebuild_cache, folder_name: old_folder_name} }
203204
has_error = false
204205
error_message = nil
205206
# rebuild caches
@@ -235,9 +236,11 @@ module PlaceOS::FrontendLoader
235236
if download_required
236237
Log.trace { "#{repository.folder_name}: downloading new content" }
237238
commit_ref = repository.commit_hash == "HEAD" ? repository.branch : repository.commit_hash
238-
commit = if root = repository.root_path
239+
commit = if (root = repository.root_path) && !root.blank?
240+
Log.trace { "Fetching folder as root_path property is set: '#{root}', size: #{root.size}" }
239241
cache.fetch_folder(commit_ref, root, repository_directory)
240242
else
243+
Log.trace { {message: "Fetching commit", commit_ref: commit_ref, repo_dir: repository_directory} }
241244
cache.fetch_commit(commit_ref, repository_directory)
242245
end
243246

0 commit comments

Comments
 (0)