diff --git a/archivebox/tests/test_setup_script.py b/archivebox/tests/test_setup_script.py index dbb5e26e..04a56cd4 100644 --- a/archivebox/tests/test_setup_script.py +++ b/archivebox/tests/test_setup_script.py @@ -47,6 +47,12 @@ def test_setup_script_prints_root_safe_runtime_commands(): assert "--connect-timeout 1 --max-time 2" in script +def test_setup_script_does_not_clear_without_a_terminal(): + script = SETUP_SCRIPT.read_text() + + assert "if [ -t 1 ]; then\n clear\nfi" in script + + def test_setup_script_moves_legacy_collection_without_moving_compose(tmp_path): script = SETUP_SCRIPT.read_text() function_prefix = script.partition("\ndocker_pull_archivebox() {")[0] diff --git a/bin/setup.sh b/bin/setup.sh index 5a6ecc20..826793f8 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -17,7 +17,9 @@ fi if (set -o errtrace) 2>/dev/null; then set -o errtrace fi -clear +if [ -t 1 ]; then + clear +fi RUNNING_AS_ROOT="false" ARCHIVEBOX_SYSTEM_USER="archivebox"