Skip to content

Commit

Permalink
Allow custom paths
Browse files Browse the repository at this point in the history
  • Loading branch information
leomeinel committed Sep 13, 2022
1 parent 78d2fb4 commit 8befca2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 23 deletions.
19 changes: 0 additions & 19 deletions all-repos

This file was deleted.

23 changes: 23 additions & 0 deletions clone
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
###
# File: clone
# Author: Leopold Meinel ([email protected])
# -----
# Copyright (c) 2022 Leopold Meinel & contributors
# SPDX ID: GPL-3.0-or-later
# URL: https://www.gnu.org/licenses/gpl-3.0-standalone.html
# -----
###

NAME="LeoMeinel"

PAGE=1
case "$1" in
all)
while curl -s "https://api.github.com/users/$2/repos?page=$PAGE&per_page=100" | grep -q "ssh_url"; do
SSH_URLS=$(curl -s "https://api.github.com/users/$2/repos?page=$PAGE&per_page=100" | grep -e 'ssh_url' | cut -d \" -f 4)
xargs -L 1 git -C "$3" clone <<<"$SSH_URLS"
PAGE=$((PAGE + 1))
done
;;
esac
22 changes: 18 additions & 4 deletions gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,34 @@
# -----
###

DIRECTORIES=$(/usr/bin/find "$2" -type f -name 'build.gradle' -printf '%h\n' | sort -u)
case "$1" in
update-gradle)
DIRECTORIES=$(/usr/bin/find ~/src/ -type f -name 'build.gradle' -printf '%h\n' | sort -u)
update)
for directory in $DIRECTORIES; do
cd "$directory"
gradle wrapper --gradle-version 7.5.1
done
;;
build-all)
DIRECTORIES=$(/usr/bin/find ~/src/ -type f -name 'build.gradle' -printf '%h\n' | sort -u)
build)
for directory in $DIRECTORIES; do
cd "$directory"
gradle build
done
;;
move)
for directory in $DIRECTORIES; do
cp "$directory"/build/libs/* "$3"
rm -rf "$directory"/build/libs/*
done
;;
clean)
for directory in $DIRECTORIES; do
cd "$directory"
gradle clean
rm -rf "$directory"/build
rm -rf "$directory"/bin
rm -rf "$directory"/.gradle
done
;;
esac
cd ~

0 comments on commit 8befca2

Please sign in to comment.