Make install script bash-compatible
This commit is contained in:
		
							parent
							
								
									5293d3ebe6
								
							
						
					
					
						commit
						f2734c33ed
					
				
							
								
								
									
										18
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								install.sh
									
									
									
									
									
								
							| 
						 | 
					@ -1,19 +1,13 @@
 | 
				
			||||||
#!/bin/zsh
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# In case this file was run via curl
 | 
					# In case this file was run via curl
 | 
				
			||||||
[ ! -d ~/.dotfiles ] && git clone https://github.com/hlissner/dotfiles ~/.dotfiles
 | 
					[ ! -d ~/.dotfiles ] && git clone https://github.com/hlissner/dotfiles ~/.dotfiles
 | 
				
			||||||
[ ! -d ~/.zprezto ] && git clone --recursive https://github.com/hlissner/prezto ~/.zprezto
 | 
					[ ! -d ~/.zprezto ] && git clone --recursive https://github.com/hlissner/prezto ~/.zprezto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
setopt EXTENDED_GLOB
 | 
					shopt -s extglob
 | 
				
			||||||
for rcfile in "${ZDOTDIR:-$HOME}"/.dotfiles/^(bin|README.md|Gemfile|install.sh)(N); do
 | 
					for rcfile in "$HOME"/.dotfiles/!(bin|README.md|Gemfile|install.sh); do
 | 
				
			||||||
    filep="${ZDOTDIR:-$HOME}/.${rcfile:t}"
 | 
					    filep="$HOME/."$(basename "$rcfile")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [ -e "$filep" ]; then
 | 
					    [ -e "$filep" ] && continue
 | 
				
			||||||
        echo "~/.${rcfile:t} already existed. Skipping..."
 | 
					    ln -vs "$rcfile" $filep
 | 
				
			||||||
        continue
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        echo "Linking ${rcfile:t} to ~/.${rcfile:t}"
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ln -s "$rcfile" $filep
 | 
					 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue