mirror of
				https://github.com/mitchell/dotfiles.git
				synced 2025-10-27 19:25:26 +00:00 
			
		
		
		
	Add repeat fish function and refactor sync script variables
This commit is contained in:
		
							parent
							
								
									dd7e7e3857
								
							
						
					
					
						commit
						3f93599ba4
					
				
							
								
								
									
										5
									
								
								.config/fish/functions/repeat.fish
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.config/fish/functions/repeat.fish
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | ||||||
|  | function repeat -a count -d 'Repeat the given action the given number of times' | ||||||
|  |     for i in (seq $count) | ||||||
|  |         $argv[2..-1] | ||||||
|  |     end | ||||||
|  | end | ||||||
							
								
								
									
										10
									
								
								sync
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								sync
									
									
									
									
									
								
							|  | @ -1,9 +1,9 @@ | ||||||
| #!/usr/bin/env fish | #!/usr/bin/env fish | ||||||
| 
 | 
 | ||||||
| function main | function main | ||||||
|     set start_dir (pwd) |     set -l start_dir (pwd) | ||||||
|     set cwd (string match -r '\w+$' $start_dir) |     set -l cwd (string match -r '\w+$' $start_dir) | ||||||
|     set uname (uname) |     set -l uname (uname) | ||||||
| 
 | 
 | ||||||
|     echo 'Syncing configuration files to your home dir...' |     echo 'Syncing configuration files to your home dir...' | ||||||
|     set_color grey |     set_color grey | ||||||
|  | @ -55,7 +55,7 @@ function sync_terminal_env | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| function sync_desktop_env | function sync_desktop_env | ||||||
|     set prompt 'Would you like to sync the desktop environment?' |     set -l prompt 'Would you like to sync the desktop environment?' | ||||||
|     read -p "set_color red; printf '\n$prompt (y/N) '; set_color normal" sync_desktop_env |     read -p "set_color red; printf '\n$prompt (y/N) '; set_color normal" sync_desktop_env | ||||||
| 
 | 
 | ||||||
|     if test "$sync_desktop_env" = 'y'; or test "$sync_desktop_env" = 'Y' |     if test "$sync_desktop_env" = 'y'; or test "$sync_desktop_env" = 'Y' | ||||||
|  | @ -88,7 +88,7 @@ function install_nvim_plugins | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| function set_git_user | function set_git_user | ||||||
|     set prompt 'Would you like to set your git user name and email?' |     set -l prompt 'Would you like to set your git user name and email?' | ||||||
|     read -p "set_color red; printf '\n$prompt (y/N) '; set_color normal" set_git_user |     read -p "set_color red; printf '\n$prompt (y/N) '; set_color normal" set_git_user | ||||||
| 
 | 
 | ||||||
|     if test "$set_git_user" = 'y'; or test "$set_git_user" = 'Y' |     if test "$set_git_user" = 'y'; or test "$set_git_user" = 'Y' | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue