Fix zsh config inclusion
This commit is contained in:
		
							
								
								
									
										13
									
								
								zsh/.oh-my-zsh_old/plugins/torrent/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								zsh/.oh-my-zsh_old/plugins/torrent/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| # torrent | ||||
|  | ||||
| This plugin creates a Torrent file based on a [MagnetURI](https://en.wikipedia.org/wiki/Magnet_URI_scheme). | ||||
|  | ||||
| To use it, add `torrent` to the plugins array in your zshrc file. | ||||
|  | ||||
| ```zsh | ||||
| plugins=(... torrent) | ||||
| ``` | ||||
|  | ||||
| ## Plugin commands | ||||
|  | ||||
| * `magnet_to_torrent <MagnetURI>`: creates Torrent file. | ||||
							
								
								
									
										17
									
								
								zsh/.oh-my-zsh_old/plugins/torrent/torrent.plugin.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								zsh/.oh-my-zsh_old/plugins/torrent/torrent.plugin.zsh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| # | ||||
| # Algorithm borrowed from http://wiki.rtorrent.org/MagnetUri and adapted to work with zsh. | ||||
| # | ||||
|  | ||||
| function magnet_to_torrent() { | ||||
| 	[[ "$1" =~ xt=urn:btih:([^\&/]+) ]] || return 1 | ||||
|  | ||||
| 	hashh=${match[1]} | ||||
|  | ||||
| 	if [[ "$1" =~ dn=([^\&/]+) ]];then | ||||
| 	  filename=${match[1]} | ||||
| 	else | ||||
| 	  filename=$hashh | ||||
| 	fi | ||||
|  | ||||
| 	echo "d10:magnet-uri${#1}:${1}e" > "$filename.torrent" | ||||
| } | ||||
		Reference in New Issue
	
	Block a user