From f2be3e63b3e1bb706185d5939dcd0b47e3879bf4 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 20 Mar 2020 19:59:14 +0000 Subject: [PATCH] move git config setup to user.sh --- dev-setup/hugo.sh | 2 -- user.sh | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dev-setup/hugo.sh b/dev-setup/hugo.sh index 4bb221c..d1bc607 100755 --- a/dev-setup/hugo.sh +++ b/dev-setup/hugo.sh @@ -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" diff --git a/user.sh b/user.sh index ff32f34..7939c0e 100755 --- a/user.sh +++ b/user.sh @@ -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