move git config setup to user.sh

This commit is contained in:
Ray Elliott 2020-03-20 19:59:14 +00:00
parent cf4ca66c03
commit f2be3e63b3
2 changed files with 6 additions and 3 deletions

View File

@ -29,8 +29,6 @@ $_cmd_su "cd ~ && hugo new site $_hugo_site_name"
$_cmd_su "cd $_site_path && git init"
$_cmd_su "echo '/themes/' >> $_site_path/.gitignore"
$_cmd_su "echo 'node_modules/' >> $_site_path/.gitignore"
$_cmd_su "git config --global user.email '$_git_user_email'"
$_cmd_su "git config --global user.name '$_git_user_name'"
$_cmd_su "cd $_site_path && git add . && git commit -m 'initial commit'"
echo "#!/bin/sh" > "$_serve_script_path"

View File

@ -1,5 +1,7 @@
#!/bin/sh
_cmd_su="su --login $_user -c"
useradd -m -s /bin/bash "$_user"
groupadd sudo
usermod -aG sudo "$_user"
@ -10,10 +12,13 @@ passwd -d "$_user"
chage -d 0 "$_user"
if command -v apt-get ; then
apt-get update && apt-get -y upgrade && apt-get -y install sudo
apt-get update && apt-get -y upgrade && apt-get -y install sudo git
else
echo "Error - no package installer found."
exit 1
fi
$_cmd_su "git config --global user.email '$_git_user_email'"
$_cmd_su "git config --global user.name '$_git_user_name'"
# TODO ensure group sudo is allowed sudo