-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwpgit.sh
More file actions
executable file
·96 lines (80 loc) · 2.42 KB
/
wpgit.sh
File metadata and controls
executable file
·96 lines (80 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# @(#) wpgit version 1.0.0 09/17/2018
#
# USAGE:
# ./wpgit.sh status
#
# DESCRIPTION:
# WikiPathways modular repository management utility.
# This script is only for developers.
#
# Requirments:
# - git
#
# By Alex Pico (alex.pico@gladstone.ucsf.edu)
# Adapted from cy.sh by Keiichiro Ono (kono at ucsd edu)
#
###############################################################################
# Repository names
REPOSITORIES=(. mediawiki vendor skins/Vector extensions/GPML extensions/GPMLConverter extensions/OntologyTags extensions/WikiPathways)
# Command Name
CMDNAME="./$(basename $0)"
# Error Message
ERROR_MESSAGE="Usage: $CMDNAME [-h] [action]"
# Help
HELP='Cytoscape build helper script'
#######################################
# Handling command-line arguments #
#######################################
while getopts 'hd:' OPT
do
case $OPT in
h) FLG_H=1
echo "$HELP: $ERROR_MESSAGE"
exit 0
;;
?) echo $ERROR_MESSAGE 1>&2
exit 1 ;;
esac
done
shift $(($OPTIND - 1))
COMMAND=$1
TARGET_DIR=$2
if [[ -z $COMMAND ]]; then
echo "COMMAND is required. $ERROR_MESSAGE" 1>&2
exit 1
fi
###############################################################################
# Functions
###############################################################################
#function pull {
# echo "------------------------------------------------------------------------"
# for REPO in "${REPOSITORIES[@]}"; do
# pushd $REPO > /dev/null
# echo "Downloading changes from upstream: $REPO"
# git pull
# popd > /dev/null
# echo "------------------------------------------------------------------------"
# done
#}
function status {
echo "------------------------------------------------------------------------"
for REPO in "${REPOSITORIES[@]}"; do
pushd $REPO > /dev/null || { echo Could not find subproject; exit 1; }
echo "- $REPO:"
echo
git status
popd > /dev/null
echo "------------------------------------------------------------------------"
done
}
###############################################################################
# Main workflow
###############################################################################
# Save current directory location
START_DIR=$(pwd)
case $COMMAND in
#pull ) pull ;;
status ) status ;;
* ) echo "Invalid command $COMMAND: $ERROR_MESSAGE"
exit 1;;
esac