diff --git a/.DS_Store b/.DS_Store index eebdf89..0768634 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/gitscan b/gitscan index d54e922..2eadeb0 100755 --- a/gitscan +++ b/gitscan @@ -1,15 +1,13 @@ #!/bin/bash -output_file=~/workshop/repos.txt +output_file="./repos.txt" -# Ensure the output directory exists -mkdir -p "$(dirname "$output_file")" - -# Clear the existing file +# Clear the existing file or create it if it doesn't exist > "$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"