| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | require "hbc/artifact/symlinked" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  | module Hbc | 
					
						
							|  |  |  |   module Artifact | 
					
						
							|  |  |  |     class Binary < Symlinked | 
					
						
							| 
									
										
										
										
											2017-04-06 00:33:31 +02:00
										 |  |  |       def link(command: nil, **options) | 
					
						
							|  |  |  |         super(command: command, **options) | 
					
						
							| 
									
										
										
										
											2017-04-20 14:38:16 +10:00
										 |  |  |         return if source.executable? | 
					
						
							|  |  |  |         if source.writable? | 
					
						
							|  |  |  |           FileUtils.chmod "+x", source | 
					
						
							|  |  |  |         else | 
					
						
							| 
									
										
										
										
											2017-04-06 00:33:31 +02:00
										 |  |  |           command.run!("/bin/chmod", args: ["+x", source], sudo: true) | 
					
						
							| 
									
										
										
										
											2017-04-20 14:38:16 +10:00
										 |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-03-08 16:35:02 +01:00
										 |  |  |       end | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | end |