_list_blog: Another rewrite
This commit is contained in:
		
							
								
								
									
										13
									
								
								qsgen2
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								qsgen2
									
									
									
									
									
								
							@@ -170,17 +170,20 @@ export blogdate=$( date +%a-%Y-%b-%d )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function _list_blog() {
 | 
					function _list_blog() {
 | 
				
			||||||
    local debug=false
 | 
					    local debug=false
 | 
				
			||||||
    # local blog_files=(blog/*.blog)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Check if array is empty
 | 
					    # Temporarily set null_glob for this function
 | 
				
			||||||
    if [[ -z "$(ls -A blog/*.blog 2>/dev/null)" ]]; then
 | 
					    setopt local_options null_glob
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Check if there are any .blog files in the blog directory
 | 
				
			||||||
 | 
					    local blog_files=(blog/*.blog)
 | 
				
			||||||
 | 
					    if (( ${#blog_files} == 0 )); then
 | 
				
			||||||
        if (${debug}); then _msg debug "_list_blog: No blog files found."; fi
 | 
					        if (${debug}); then _msg debug "_list_blog: No blog files found."; fi
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    else
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for file in blog/*.blog; do
 | 
					    for file in blog/*.blog; do
 | 
				
			||||||
        blogs_file_array+=("$file")
 | 
					        blogs_file_array+=("$file")
 | 
				
			||||||
    done
 | 
					    done
 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# BLOG CACHE
 | 
					# BLOG CACHE
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user