mirror of
				https://github.com/AquaMorph/dotfiles.git
				synced 2025-11-03 17:03:18 +00:00 
			
		
		
		
	Linking directories
This commit is contained in:
		@@ -4,11 +4,12 @@ dotdir=~/dotfiles
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# src dest sudo
 | 
					# src dest sudo
 | 
				
			||||||
files=($dotdir/.zshrc ~/ 'n' \
 | 
					files=($dotdir/.zshrc ~/ 'n' \
 | 
				
			||||||
       ${dotdir}/alacritty/alacritty.yml ~/.config/alacritty/ 'n')
 | 
					       ${dotdir}/alacritty/alacritty.yml ~/.config/alacritty/ 'n'
 | 
				
			||||||
 | 
					       ${dotdir}/g13 ~/.config/ 'n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo Setting up dotfiles...
 | 
					echo Setting up dotfiles...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 
 | 
					# Loop through config files
 | 
				
			||||||
for (( i=0; i<${#files[@]} ; i+=3 )) ; do
 | 
					for (( i=0; i<${#files[@]} ; i+=3 )) ; do
 | 
				
			||||||
    # Check if sudo is needed
 | 
					    # Check if sudo is needed
 | 
				
			||||||
    pre=''
 | 
					    pre=''
 | 
				
			||||||
@@ -19,11 +20,12 @@ for (( i=0; i<${#files[@]} ; i+=3 )) ; do
 | 
				
			|||||||
    destPath=${files[i+1]}$(basename "${files[i]}")
 | 
					    destPath=${files[i+1]}$(basename "${files[i]}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Check if file already exists
 | 
					    # Check if file already exists
 | 
				
			||||||
    if [ -f $destPath ]; then
 | 
					    if [ -e $destPath ]; then
 | 
				
			||||||
	# Check if path is not a sybolic link
 | 
						# Check if path is not a sybolic link
 | 
				
			||||||
	if ! [ -L $destPath ]; then
 | 
						if ! [ -L $destPath ]; then
 | 
				
			||||||
	    echo Backing up $destPath
 | 
						    echo Backing up $destPath
 | 
				
			||||||
	    $pre mv $destPath ${destPath}.bak
 | 
						    $pre mv $destPath ${destPath}.bak
 | 
				
			||||||
 | 
						# File already set up
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
	    echo The file $destPath is already set up
 | 
						    echo The file $destPath is already set up
 | 
				
			||||||
	    continue
 | 
						    continue
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user