-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathst
39 lines (30 loc) · 1.28 KB
/
st
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
#!/bin/bash
#: Title: st
#: Date: Mon Jun 10 07:55:48 DST 2019
#: Author: WessCoby
#: Version: 1.0.0
#: Description: Git status command
### Git Prefix specifying the current working directory
gitDirectoryPath="$PWD"
#===========================================================================================
#======================== HELPER FUNCTIONS ===========================
#===========================================================================================
status() {
git -C ${gitDirectoryPath} status
}
#==========================================================================================
# START
#==========================================================================================
### Check if current directory is a git repository
isInsideGitRepo="$(git rev-parse --is-inside-work-tree 2>/dev/null)"
if [[ isInsideGitRepo ]];
then
git status;
else
errlog "This Directory is not a Git repository";
exit 0;
fi
#==========================================================================================
# DONE
#==========================================================================================
exit 0