Skip to content

Commit

Permalink
emit script and pwd path at start; setupEnv has paths relative to script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjenni committed Jan 22, 2024
1 parent ef1d8ec commit b43febc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

originGitHub='https://github.com/davidjenni/dotfiles.git'
dotPath=$HOME/dotfiles
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

shopt -s nocasematch

Expand Down Expand Up @@ -158,7 +159,7 @@ function copyFile {
fi
targetDir=$(dirname $target)
mkdir -p $targetDir
sourceFile=$dotPath/$sourceRelPath
sourceFile=$scriptDir/$sourceRelPath
echo " $sourceFile -> $target"
cp $sourceFile $target
}
Expand All @@ -171,15 +172,15 @@ function copyDir {
rm -rf $targetDir >&/dev/null
fi
mkdir -p $targetDir
sourceDir=$dotPath/$sourceRelPath
sourceDir=$scriptDir/$sourceRelPath
echo " $sourceDir -> $targetDir"
cp -R $sourceDir/* $targetDir
}

function setupShellEnv {
echo "Setting up shell environment..."
ensureGitNames noprompt
writeGitConfig $dotPath/gitconfig.ini
writeGitConfig $scriptDir/gitconfig.ini

local configDir=$HOME/.config
if [ ! -d "$configDir" ] ; then
Expand Down Expand Up @@ -290,5 +291,5 @@ main() {
echo "Done."
}

echo "Starting bootstrap.sh..."
echo "Starting bootstrap.sh (in $scriptDir with working dir: $(pwd))..."
main $*

0 comments on commit b43febc

Please sign in to comment.