cli icon indicating copy to clipboard operation
cli copied to clipboard

Lando lagoon integration .gitconfig & known_hosts missing

Open almunnings opened this issue 3 years ago • 0 comments

When using lando ssh into the cli container, the user's $HOME is set to /home

This doesnt play ball with the symlinking that occurs in https://github.com/lando/cli/blob/7325253b4284030d2913f97bc6812b1a97b6fc24/plugins/lando-core/scripts/user-perms.sh#L56-L67

Net result is: git config --global --list

fatal: unable to read config file '/home/.gitconfig': No such file or directory

Its a nice subtle detail to have the users .gitconfig available in the cli :)

I've locally got around this by putting the following into /scripts for my lagoon builds (non-clobbering):

#!/bin/sh
set -e

if [ ! -f $HOME/.gitconfig ] && [ -f /user/.gitconfig ]; then
  ln -sf /user/.gitconfig $HOME/.gitconfig
fi

if [ ! -f $HOME/.ssh/known_hosts ] && [ -f /user/.ssh/known_hosts ]; then
  ln -sf /user/.ssh/known_hosts $HOME/.ssh/known_hosts
fi

But maybe theres a better place to integrate this?

almunnings avatar Sep 15 '21 23:09 almunnings