small fix for index file check
This commit is contained in:
		
							parent
							
								
									4e48166bc6
								
							
						
					
					
						commit
						db464d16f3
					
				| 
						 | 
				
			
			@ -109,11 +109,14 @@ class Admin::HpsLearningsController < OrbitAdminController
 | 
			
		|||
    Zip::ZipFile.open(path) { |zip_file|
 | 
			
		||||
     zip_file.each { |f|
 | 
			
		||||
       f_path=File.join(destination, f.name)
 | 
			
		||||
       zip_file.extract(f, f_path) unless File.exist?(f_path)
 | 
			
		||||
       files << f.name
 | 
			
		||||
       zip_file.extract(f, f_path) unless File.exist?(f_path)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    if files.include?("index.html")
 | 
			
		||||
    foldername = File.basename(path).split(".")
 | 
			
		||||
    foldername.pop
 | 
			
		||||
    foldername = foldername.join(".")
 | 
			
		||||
    if files.include?(foldername + "/index.html")
 | 
			
		||||
      render :json => {"success" => true}.to_json
 | 
			
		||||
    else
 | 
			
		||||
      render :json => {"success" => false, "msg" => "index.html file not present."}.to_json
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue