Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ed44e2b
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# g | ||
|
||
Use instead of git. | ||
|
||
## Usage: | ||
|
||
``` | ||
g add file | ||
g add . | ||
g commit -m "message | ||
g push origin branch-name | ||
g log | ||
``` | ||
|
||
## Features | ||
|
||
if the file is a js file, it will try to validate the syntax before adding | ||
it to the repo, if the file has bad syntax, it will not be added to the repo. | ||
|
||
## Supported Languages | ||
|
||
- Javascript | ||
|
||
## Upcoming | ||
|
||
- Maybe CSS, php, etc. | ||
|
||
## Installation: | ||
|
||
put it on a file in your machine and later ad this line to bashrc: | ||
|
||
export PATH=$PATH:/place/where/you/put/the/command | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# vim: syn=sh | ||
|
||
# This file will check before adding on git, use as you would | ||
# normally use git. | ||
# Apologies for using bash, I guess I guess we can add | ||
# more languages in the futurewith care. | ||
|
||
do_add() { | ||
for file in "$PARAMS" | ||
do | ||
case $file in *.js ) | ||
printf "$(tput setaf 1)" | ||
node --check $file && git $CMD $file | ||
printf "$(tput sgr0)" | ||
;; | ||
* ) | ||
echo "$(tput setaf 1)Unchecked$(tput sgr0)" | ||
git $CMD $file | ||
esac | ||
done | ||
} | ||
main () { | ||
if [ "$CMD" = "add" ]; then | ||
do_add | ||
else | ||
git $CMD $PARAMS | ||
fi | ||
} | ||
|
||
CMD=$1 | ||
shift | ||
PARAMS=$@ | ||
main | ||
|
||
|