Created
November 20, 2023 01:44
-
-
Save aaomidi/baaeeaa48937066f39cc8e9405d92c54 to your computer and use it in GitHub Desktop.
Organize your github clones automatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Extract the organization and repo name from the argument | |
ORG=$(echo "$1" | cut -d '/' -f 1) | |
REPO=$(echo "$1" | cut -d '/' -f 2) | |
# Define the base directory | |
BASE_DIR="$HOME/Projects" | |
# Create the directory structure | |
mkdir -p -- "$BASE_DIR/$ORG" | |
# Clone the repo into the specified directory | |
gh repo clone "$1" "$BASE_DIR/$ORG/$REPO" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment