tasyagle-install: Added check with .bashrc, commented out doc generation
authorAndrey Miroshnikov <andrey@technepisteme.xyz>
Mon, 25 Jul 2022 15:41:58 +0000 (16:41 +0100)
committerAndrey Miroshnikov <andrey@technepisteme.xyz>
Mon, 25 Jul 2022 15:41:58 +0000 (16:41 +0100)
tasyagle-install

index af3cd1507f8bba82efad436fe1bf6da1f59a9096..97a5f639567f30fd3e2dddec3f902f06238688fb 100755 (executable)
@@ -24,12 +24,24 @@ cd /home/$SUDO_USER/src
 chown -R $SUDO_USER .
 chgrp -R $SUDO_USER .
 
-echo "Adding avt_env.sh to .bashrc"
-echo "source /usr/local/avt_env.sh" >> /home/$SUDO_USER/.bashrc
+STRING="source /usr/local/avt_env.sh"
+if  grep -q "$STRING" /home/$SUDO_USER/.bashrc ; then
+       echo 'avt_env.sh already in .bashrc'
+else
+       echo 'Adding avt_env.sh to .bashrc'
+       echo "$STRING" >> /home/$SUDO_USER/.bashrc
+       chown -R $SUDO_USER /home/$SUDO_USER/.bashrc
+       chgrp -R $SUDO_USER /home/$SUDO_USER/.bashrc
+fi
+
 
 # Compile the documentation
-cd tas-yagle/distrib/docxml2
-make
+# source the file, otherwise can't compile docs...
+# TODO: source doesn't work within script, do manually as normal user
+# for now
+#source /home/$SUDO_USER/.bashrc
+#cd tas-yagle/distrib/docxml2
+#make
 
 cd /home/$SUDO_USER/src
 chown -R $SUDO_USER .