forked from ungleich-public/cdist
		
	[__package_pip] detect pip binary
This commit is contained in:
		
					parent
					
						
							
								2885c6a248
							
						
					
				
			
			
				commit
				
					
						decc0ad54d
					
				
			
		
					 3 changed files with 17 additions and 2 deletions
				
			
		
							
								
								
									
										10
									
								
								cdist/conf/type/__package_pip/explorer/pip
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								cdist/conf/type/__package_pip/explorer/pip
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
#!/bin/sh -e
 | 
			
		||||
 | 
			
		||||
for bin in pip3 pip
 | 
			
		||||
do
 | 
			
		||||
    if check="$( command -v "$bin" )"
 | 
			
		||||
    then
 | 
			
		||||
        echo "$check"
 | 
			
		||||
        break
 | 
			
		||||
    fi
 | 
			
		||||
done
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ pipparam="$__object/parameter/pip"
 | 
			
		|||
if [ -f "$pipparam" ]; then
 | 
			
		||||
    pip=$(cat "$pipparam")
 | 
			
		||||
else
 | 
			
		||||
    pip="pip"
 | 
			
		||||
    pip="$( "$__type_explorer/pip" )"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# If there is no pip, it may get created from somebody else.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,12 @@ pipparam="$__object/parameter/pip"
 | 
			
		|||
if [ -f "$pipparam" ]; then
 | 
			
		||||
    pip=$(cat "$pipparam")
 | 
			
		||||
else
 | 
			
		||||
    pip="pip"
 | 
			
		||||
    pip="$( cat "$__object/explorer/pip" )"
 | 
			
		||||
    if [ -z "$pip" ]
 | 
			
		||||
    then
 | 
			
		||||
        echo 'pip not found in path' >&2
 | 
			
		||||
        exit 1
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
runasparam="$__object/parameter/runas"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue