From 50d2bb80ac585674d1b9b7e6bbfc1f224bd4b71c Mon Sep 17 00:00:00 2001 From: sanj <67624670+iodrift@users.noreply.github.com> Date: Sat, 3 Aug 2024 00:22:15 -0700 Subject: [PATCH] routine update --- .DS_Store | Bin 6148 -> 6148 bytes gitscan | 12 +++++------- pippin | 34 ++++++++++++++++++++++++++++++++++ pull | 7 +++++-- 4 files changed, 44 insertions(+), 9 deletions(-) create mode 100755 pippin diff --git a/.DS_Store b/.DS_Store index eebdf89bf3aa236068317f0e8536f325992797e5..07686343f2dd3e5896e91be99badcd3b70b322e8 100644 GIT binary patch delta 113 zcmZoMXfc?uELKo}fq{XAL60GwA(NpbH{Zo2DJMS(D8})7?|Xj^{bP=(@+olnAQhi! k2lY_p3o;CYlk;;6fO;4h*fwkyWcZoZ34QcivnP>e&a`n>3Vy "$output_file" -# Find all .git directories, excluding hidden directories and suppressing permission denied errors -find ~/ -type d -name ".git" -not -path "*/.*/*" 2>/dev/null | while read -r gitdir; do +# Find all .git directories in the current folder and subfolders, +# excluding hidden directories and suppressing permission denied errors +find . -type d -name ".git" -not -path "*/.*/*" 2>/dev/null | while read -r gitdir; do # Get the parent directory of the .git folder repo_path=$(dirname "$gitdir") echo "$repo_path" >> "$output_file" diff --git a/pippin b/pippin new file mode 100755 index 0000000..9075300 --- /dev/null +++ b/pippin @@ -0,0 +1,34 @@ +#!/bin/bash + +# Check if an argument is provided +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Get the conda environment name from the command line argument +env_name="$1" + +# Check if the conda environment already exists +if ! conda info --envs | grep -q "^$env_name "; then + echo "Creating new conda environment: $env_name" + conda create -n "$env_name" python=3.9 -y +else + echo "Conda environment '$env_name' already exists" +fi + +# Activate the conda environment +eval "$(conda shell.bash hook)" +conda activate "$env_name" + +# Get the path to the conda environment's python binary +conda_python=$(which python) + +# Recursively search for requirements.txt files and install dependencies +find . -name "requirements.txt" | while read -r req_file; do + echo "Installing requirements from: $req_file" + "$conda_python" -m pip install -r "$req_file" +done + +echo "All requirements.txt files processed." + diff --git a/pull b/pull index 9a794e9..fa8fa1a 100755 --- a/pull +++ b/pull @@ -1,10 +1,10 @@ #!/bin/bash -repos_file=~/workshop/repos.txt +repos_file="./repos.txt" # Check if the repos file exists if [ ! -f "$repos_file" ]; then - echo "Error: $repos_file does not exist." + echo "Error: $repos_file does not exist in the current directory." exit 1 fi @@ -34,6 +34,9 @@ while IFS= read -r repo_path || [[ -n "$repo_path" ]]; do echo "Force pulling latest changes..." git pull --force + # Return to the original directory + cd - > /dev/null + echo "Update complete for $repo_path" echo "----------------------------------------" done < "$repos_file"