Look in /etc/manpaths for writable paths
This commit is contained in:
		
							parent
							
								
									637de14699
								
							
						
					
					
						commit
						85d5352e6e
					
				
							
								
								
									
										10
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Rakefile
									
									
									
									
									
								
							@ -10,8 +10,14 @@ RuboCop::RakeTask.new
 | 
				
			|||||||
RSpec::Core::RakeTask.new(:rspec)
 | 
					RSpec::Core::RakeTask.new(:rspec)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
task :create_man do |_t|
 | 
					task :create_man do |_t|
 | 
				
			||||||
  os_prefix = "/usr/local"
 | 
					  writable_man_path = Pathname('/etc/manpaths').each_line.find do |line|
 | 
				
			||||||
  man_prefix = Pathname("#{os_prefix}/share/man/man1")
 | 
					    path = Pathname(line.chomp)
 | 
				
			||||||
 | 
					    path.directory? && path.writable?
 | 
				
			||||||
 | 
					  end rescue nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return unless writable_man_path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  man_prefix = Pathname("#{writable_man_path.chomp}/man1")
 | 
				
			||||||
  man_pages = "man/git-*.1"
 | 
					  man_pages = "man/git-*.1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Pathname.glob(man_pages) do |path|
 | 
					  Pathname.glob(man_pages) do |path|
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user