-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstatus.sh
79 lines (65 loc) · 1.92 KB
/
status.sh
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
#!/bin/bash
######################################
## Validation
if [[ $_ == $0 ]]
then
>&2 echo "This script must be sourced. Use this command instead:"
>&2 echo " source $0"
exit 0
fi
echo -e "\n\n"
echo "********************************************************"
echo "* STATUS REPORT"
echo "********************************************************"
echo "*"
echo "* Using wstool info and wstool status."
echo "*"
echo "* - Status script"
echo "* $(date)"
echo "*"
echo "********************************************************"
echo -e "\n\n"
######################################
## Preparation
# Get the shell extention
SHELL_EXTENSION=$(ps -ocomm= -q $$)
# Get the workspace path
if [[ $SHELL_EXTENSION == "bash" ]]
then
WSDIR=$(readlink -f $(dirname $(dirname "${BASH_SOURCE[0]}")))
elif [[ $SHELL_EXTENSION == "zsh" ]]
then
WSDIR="$(dirname $(readlink -f ${0%/*}))";
else
echo "This shell is not supported. Please use bash or zsh."
exit -1 # Not permitted
fi
# Source the workspace
source "$WSDIR/script/setup.sh"
# Move to the workspace
cd "$WSDIR"
######################################
## Status report
echo "********* wstool info *****************"
echo "*"
echo "* The Status (S) column shows"
echo "* x for missing"
echo "* L for uncommited (local) changes"
echo "* V for difference in version and/or remote URI"
echo "* C for difference in local and remote versions"
echo "* M for modified"
echo "*"
wstool info -s -t src --fetch -u 2>/dev/null | sed 's/^/* /'
echo "*"
echo "*"
echo -e "*****************************************\n\n"
echo "********* wstool status ***************"
echo "*"
wstool status -t src -u 2>/dev/null | sed 's/^/* /'
echo "*"
echo "*"
echo -e "*****************************************\n\n"
######################################
## End
# Move back to the original position
cd - > /dev/null