Determine source_is only if destination is symlink.
This commit is contained in:
		
					parent
					
						
							
								6895ad0207
							
						
					
				
			
			
				commit
				
					
						e860f1c792
					
				
			
		
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -33,8 +33,8 @@ destination_dir="${destination%/*}"
 | 
				
			||||||
case "$type" in
 | 
					case "$type" in
 | 
				
			||||||
   symbolic)
 | 
					   symbolic)
 | 
				
			||||||
      cd "$destination_dir" || exit 1
 | 
					      cd "$destination_dir" || exit 1
 | 
				
			||||||
      source_is=$(readlink "$destination")
 | 
					 | 
				
			||||||
      if [ -h "$destination" ]; then
 | 
					      if [ -h "$destination" ]; then
 | 
				
			||||||
 | 
					         source_is=$(readlink "$destination")
 | 
				
			||||||
         # ignore trailing slashes for comparison
 | 
					         # ignore trailing slashes for comparison
 | 
				
			||||||
         if [ "${source_is%/}" = "${source%/}" ]; then
 | 
					         if [ "${source_is%/}" = "${source%/}" ]; then
 | 
				
			||||||
            echo present
 | 
					            echo present
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue