Add pre-script to switch to correct directory for each command
Signed-off-by: Billy Brawner <billy@wbrawner.com>
This commit is contained in:
parent
7c408d6d70
commit
9eae3ed258
8 changed files with 20 additions and 0 deletions
2
delete
2
delete
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please enter a repository name"
|
||||
exit 1
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please enter a repository name"
|
||||
exit 1
|
||||
|
|
2
ls
2
ls
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
for repo in $(/usr/bin/find -maxdepth 1 -type d -name "*.git"); do /usr/bin/basename $repo .git; done | sort
|
||||
|
||||
|
|
2
mirror
2
mirror
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please enter a repository URL"
|
||||
exit 1
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
mkdir "$1"
|
||||
(
|
||||
cd "$1"
|
||||
|
|
2
new
2
new
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please enter a repository name"
|
||||
exit 1
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
REPO="$1"
|
||||
|
||||
if [[ -z "$REPO" ]]; then
|
||||
|
|
6
pre-script
Normal file
6
pre-script
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
REPO_DIR=/pub/git
|
||||
|
||||
cd $REPO_DIR
|
||||
|
Loading…
Reference in a new issue