diff --git a/src/initialize_git.sh b/src/initialize_git.sh index fcdfa3857a48620abfcbbdf5b76c46ae7270bb03..b8a07e980b3d60f20b4811a8a7386dbb7b0fbff5 100755 --- a/src/initialize_git.sh +++ b/src/initialize_git.sh @@ -26,7 +26,7 @@ function main () { # Install git and tk. echo -e "${text_blue}Checking apt for git. This may ask for your system password.${text_reset}" - sudo apt install git gitk + sudo apt install git gitk curl # Set up git email credentials for machine. user_input="" diff --git a/src/setup_python_for_development.sh b/src/setup_python_for_development.sh index 64dc4549e12b0552a03c6cfdb282ced3dd0837ac..7b286b7e41cbaaa31efef499da677a17180c1df7 100755 --- a/src/setup_python_for_development.sh +++ b/src/setup_python_for_development.sh @@ -72,9 +72,28 @@ function main () { # Install PipEnv. python3 -m pip install --user pipenv > /dev/null - echo "" - echo -e "${text_blue}Python setup complete.${text_reset}" - echo "" + # Setup Poetry (PipEnv alternative). + # Install Poetry. + curl -sSL https://install.python-poetry.org | python3 - + + # Check that .bashrc file exists. + if [[ -f "${bashrc_file}" ]] + then + # Add PipEnv settings to .bashrc file. + path_search_string="PATH=\"\$PATH:/home/${username}/.local/bin\"" + bashrc_contents="$(cat ${bashrc_file})" + + # Check if either value is not present. + if [[ ! "${bashrc_contents}" =~ "${path_search_string}" ]] + then + # Append. + echo "" >> "${bashrc_file}" + echo "" >> "${bashrc_file}" + echo "# Poetry Settings." >> "${bashrc_file}" + echo "${path_search_string}" >> "${bashrc_file}" + + fi + fi # Add updated cd function to .bashrc file. # On cd into folders, this will load any Python environments in the direct folder that match ".env" or ".venv". @@ -103,6 +122,10 @@ function main () { fi fi + + echo "" + echo -e "${text_blue}Python setup complete.${text_reset}" + echo "" }