From daed07361cfa8bb0481b68f9a945eaefb2b58661 Mon Sep 17 00:00:00 2001 From: Emmett McFaralne <staminacode@gmail.com> Date: Fri, 22 Mar 2024 00:37:50 -0400 Subject: [PATCH] install step --- README.md | 2 +- setup.py | 32 ++++++++++++++++++++++++++++++++ tests/test_extract.py | 1 + thepipe.py | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 setup.py diff --git a/README.md b/README.md index d1e01f2..f49c30f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# <img src="https://rpnutzemutbrumczwvue.supabase.co/storage/v1/object/public/assets/pipeline_small%20(1).png" alt="Pipeline Illustration" style="width:96px; height:96px; vertical-align:middle;"> The Pipe +# <img src="https://rpnutzemutbrumczwvue.supabase.co/storage/v1/object/public/assets/pipeline_small%20(1).png" alt="Pipeline Illustration" style="width:96px; height:72px; vertical-align:middle;"> The Pipe [](https://codecov.io/gh/emcf/thepipe)  diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2f17aee --- /dev/null +++ b/setup.py @@ -0,0 +1,32 @@ +import os +import platform +import sys + +def install_ctags(): + # Check if the operating system is not Windows + if platform.system() != 'Windows': + # Detect the package manager based on the distribution + if os.path.exists('/usr/bin/apt-get'): + # Detect if already installed + if os.path.exists('/usr/bin/ctags'): + return + # Debian-based systems (like Ubuntu) + os.system('sudo apt-get update && sudo apt-get install -y ctags') + elif os.path.exists('/usr/bin/yum'): + # Detect if already installed + if os.path.exists('/usr/bin/ctags'): + return + # Red Hat-based systems (like Fedora or CentOS) + os.system('sudo yum install -y ctags') + elif os.path.exists('/usr/bin/pacman'): + # Detect if already installed + if os.path.exists('/usr/bin/ctags'): + return + # Arch-based systems + os.system('sudo pacman -Syu --noconfirm ctags') + else: + print("Unsupported Linux distribution or missing package manager.") + sys.exit(1) + else: + print("This script does not support Windows.") + sys.exit(1) diff --git a/tests/test_extract.py b/tests/test_extract.py index 02f42de..98c8f53 100644 --- a/tests/test_extract.py +++ b/tests/test_extract.py @@ -1,4 +1,5 @@ +import setup import unittest import os from thepipe import extract # Assuming thepipe has an extract function diff --git a/thepipe.py b/thepipe.py index 97c0cc0..33b3555 100644 --- a/thepipe.py +++ b/thepipe.py @@ -1,3 +1,4 @@ +import setup import argparse from extractor import get_all_contents from representor import create_compressed_project_context