Skip to content

Commit

Permalink
setup-environment: symlink system wide .ssh and .gitconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Nov 4, 2018
1 parent 858badd commit ff046af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions toolchain/configuration-symlinks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
USERPROFILEPATH="$(cygpath $USERPROFILE)"

# link .gitconfig and .ssh from local home to system wide configuration if there's none yet
if [[ (-L ~/.gitconfig || ! -e ~/.gitconfig) && -e "$USERPROFILEPATH/.gitconfig" ]]; then
ln -sf $USERPROFILEPATH/.gitconfig ~/.gitconfig
fi

if [[ (-L ~/.ssh || ! -e ~/.ssh) && -e "$USERPROFILEPATH/.ssh" ]]; then
ln -sf $USERPROFILEPATH/.ssh ~/.ssh
fi
3 changes: 3 additions & 0 deletions toolchain/setup-environment-variables.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ REM home directory for the unix environment
SET HOME=%PX4_DIR%\home
REM also set it for cygwin in general to make ssh happy
CALL bash -c "sed -i '/db_home:/c\db_home: '$HOME /etc/nsswitch.conf"

REM create optional symlinks to system wide .gitconfig and .ssh
CALL bash %PX4_DIR%\toolchain\configuration-symlinks.sh

0 comments on commit ff046af

Please sign in to comment.