From 21d389267d66e22f29a01965eb5944b5db477cc2 Mon Sep 17 00:00:00 2001 From: Jesse London Date: Wed, 21 Sep 2022 10:20:37 -0500 Subject: [PATCH 1/4] setup: attempt to help OS X environments with their PATH --- setup-install | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup-install b/setup-install index 60da344a..f1de85b1 100755 --- a/setup-install +++ b/setup-install @@ -151,7 +151,16 @@ manage_on_path() { } fix_manage_path() { - [ -x "$HOME/.local/bin/manage" ] && echo -e '\nexport PATH="$HOME/.local/bin:$PATH"' >> $HOME/.profile + local path_prefix + + for path_prefix in ".local" "Library/Python/${PYTHON_EXE#python}"; do + if [ -x "$HOME/$path_prefix/bin/manage" ]; then + echo -e "\nexport PATH=\"\$HOME/$path_prefix/bin:\$PATH\"" >> $HOME/.profile + return 0 + fi + done + + return 1 } require path \ From 8073d834fab77f57e49ab3c4a1154c0338fb687a Mon Sep 17 00:00:00 2001 From: Jesse London Date: Wed, 21 Sep 2022 10:38:55 -0500 Subject: [PATCH 2/4] expanded README documentation of set-up --- README.adoc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.adoc b/README.adoc index 2953fc16..971629b8 100644 --- a/README.adoc +++ b/README.adoc @@ -22,20 +22,40 @@ If you're not sure, you can test for the presence of commands in your terminal a === Set-up -Set up your environment for textbook authoring by sourcing the repository's included Bash script: +Set up and check your environment for textbook authoring by sourcing the repository's included Bash script: $ source setup The `setup` script will guide you through installation of any further required libraries. -[TIP] -==== +==== Troubleshooting set-up + +===== Other shells + If you use a shell other than Bash, you may instead execute the following setup command directly: - ./setup-install + $ ./setup-install However, this command is unable to affect your active shell; to correct this, you may simply start a new shell. -==== + +===== Other situations + +Set-up scripting attempts to guide authors in setting up their computers; however, your computer might vary considerably from expectations! + +If you have both Docker and Python installed, the only further requirement is to install https://pypi.org/project/argcmdr/[argcmdr]. + +This may be achieved generally via `pip`, _e.g._: + + $ pip install argcmdr + +Then, the `manage` command should be available through your `PATH`: + + $ which manage + /path/to/manage + +`setup` performs the above on your behalf, attempting to correct for environmental variability. + +Issues with `setup` and the above instructions may be https://github.com/chicago-cdac/textbook-datascience-1/issues[reported as Issues]. == Authoring content From bc73e305ff91432fd893fd80c29750817edc4227 Mon Sep 17 00:00:00 2001 From: Jesse London Date: Wed, 21 Sep 2022 10:43:16 -0500 Subject: [PATCH 3/4] added table of contents to README --- README.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/README.adoc b/README.adoc index 971629b8..0ea42c61 100644 --- a/README.adoc +++ b/README.adoc @@ -1,4 +1,5 @@ = Textbook: Data Science I +:toc: preamble This repository contains the source materials, as well as the authoring and publishing tools, of the textbook of the University of Chicago course Data Science I. From f53820c3797565ad6bd76c1e77c8b611d09c18b2 Mon Sep 17 00:00:00 2001 From: Jesse London Date: Wed, 21 Sep 2022 11:00:47 -0500 Subject: [PATCH 4/4] setup: more support for OS X installation paths --- setup | 8 ++++++-- setup-install | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/setup b/setup index 861f4527..c9345670 100644 --- a/setup +++ b/setup @@ -1,5 +1,9 @@ ./setup-install -if [ -x "$HOME/.local/bin/manage" ] && ! command -v manage > /dev/null; then - export PATH="$HOME/.local/bin:$PATH" +if ! command -v manage > /dev/null; then + if [ -x "$HOME/.local/bin/manage" ]; then + export PATH="$HOME/.local/bin:$PATH" + else + source "$HOME/.profile" + fi fi diff --git a/setup-install b/setup-install index f1de85b1..812fac8d 100755 --- a/setup-install +++ b/setup-install @@ -155,7 +155,7 @@ fix_manage_path() { for path_prefix in ".local" "Library/Python/${PYTHON_EXE#python}"; do if [ -x "$HOME/$path_prefix/bin/manage" ]; then - echo -e "\nexport PATH=\"\$HOME/$path_prefix/bin:\$PATH\"" >> $HOME/.profile + echo -e "\nexport PATH=\"\$HOME/$path_prefix/bin:\$PATH\"" >> "$HOME/.profile" return 0 fi done