scripts: fix wl-copy-file path handling
This commit is contained in:
		
							parent
							
								
									7e2c9b087a
								
							
						
					
					
						commit
						a587610fd1
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -10,12 +10,13 @@ if test (count $argv) != 1
 | 
			
		|||
end
 | 
			
		||||
 | 
			
		||||
set -a file (realpath $argv[1])
 | 
			
		||||
set -a url (string escape --style=url "$file")
 | 
			
		||||
set -e argv[1]
 | 
			
		||||
 | 
			
		||||
if test -d "$file"
 | 
			
		||||
    die 1 "Cannot copy directories" >&2
 | 
			
		||||
else if test -f "$file"
 | 
			
		||||
    wl-copy $argv -t text/uri-list "file:///$file"
 | 
			
		||||
    wl-copy $argv -t text/uri-list "file:///$url"
 | 
			
		||||
else
 | 
			
		||||
    die 2 "No file found" >&2
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue