Make skeleton directories, update README, and fix repo config
This commit is contained in:
		@@ -11,4 +11,4 @@ Download and run the latest `replicate.sh`:
 | 
				
			|||||||
## Notes
 | 
					## Notes
 | 
				
			||||||
* The script assumes that you want to bootstrap `$PWD` as `$HOME`. Don't run it out of your Downloads folder.
 | 
					* The script assumes that you want to bootstrap `$PWD` as `$HOME`. Don't run it out of your Downloads folder.
 | 
				
			||||||
* By default, the repository will attempt to clone with SSH. Either generate those keys and add them to GitLab or change the repository URI to HTTP.
 | 
					* By default, the repository will attempt to clone with SSH. Either generate those keys and add them to GitLab or change the repository URI to HTTP.
 | 
				
			||||||
 | 
					* Ideally, this will be called via Ansible or some other automation tool. It may, in the future, contain specific code for this purpose.
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								replicate.sh
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								replicate.sh
									
									
									
									
									
								
							@@ -1,4 +1,5 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					name="$(basename "$0")"
 | 
				
			||||||
deps="git rsync"
 | 
					deps="git rsync"
 | 
				
			||||||
for dep in $deps; do
 | 
					for dep in $deps; do
 | 
				
			||||||
	if ! which $dep > /dev/null 2>&1; then
 | 
						if ! which $dep > /dev/null 2>&1; then
 | 
				
			||||||
@@ -6,25 +7,25 @@ for dep in $deps; do
 | 
				
			|||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					mkdir Desktop Documents Downloads Games Music Pictures Projects System Videos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
tempfolder="/tmp/dots-`whoami`"
 | 
					tempfolder="/tmp/dots-`whoami`"
 | 
				
			||||||
gitdir="$PWD/.dotfiles"
 | 
					gitdir="$PWD/.dotfiles"
 | 
				
			||||||
homedir="$PWD"
 | 
					homedir="$PWD"
 | 
				
			||||||
repo='git@gitlab.com:rehashedsalt/home.git'
 | 
					repo='git@gitlab.com:rehashedsalt/home.git'
 | 
				
			||||||
config='git --git-dir="$gitdir" --work-tree="$homedir"'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
git clone --recursive --depth 100 --separate-git-dir="$gitdir" "$repo" "$tempfolder"
 | 
					git clone --recursive --depth 100 --separate-git-dir="$gitdir" "$repo" "$tempfolder"
 | 
				
			||||||
error="$?"
 | 
					error="$?"
 | 
				
			||||||
if ! [ "$error" == "0" ]; then
 | 
					if ! [ "$error" == "0" ]; then
 | 
				
			||||||
	printf "$0: error: failed cloning repository \"$repo\": $error\n" 1>&2
 | 
						printf "$name: error: failed cloning repository \"$repo\": $error\n" 1>&2
 | 
				
			||||||
	printf "Do you have the appropriate permissions? Does the remote host know your key?\n"
 | 
						printf "Do you have the appropriate permissions? Does the remote host know your key?\n"
 | 
				
			||||||
	exit 2
 | 
						exit 2
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
rsync -rvl --exclude ".git" $tempfolder/ $homedir/
 | 
					rsync -rvl --exclude ".git" $tempfolder/ $homedir/
 | 
				
			||||||
rm -r $tempfolder
 | 
					rm -r $tempfolder
 | 
				
			||||||
$config submodule update --init --recursive --remote
 | 
					git --git-dir="$gitdir" --work-tree="$homedir" submodule update --init --recursive --remote
 | 
				
			||||||
$config config status.showUntrackedFiles no
 | 
					git --git-dir="$gitdir" --work-tree="$homedir" config status.showUntrackedFiles no
 | 
				
			||||||
printf "$0: dotfiles set up successfully\n"
 | 
					printf "$name: dotfiles set up successfully\n"
 | 
				
			||||||
printf "Be sure and configure the following before issuing any commits:\n"
 | 
					printf "Be sure and configure the following before issuing any commits:\n"
 | 
				
			||||||
printf "    git config --global user.email\n"
 | 
					printf "    git config --global user.email\n"
 | 
				
			||||||
printf "    git config --global user.name\n"
 | 
					printf "    git config --global user.name\n"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user