Skip to content

Commit

Permalink
Initialish
Browse files Browse the repository at this point in the history
  • Loading branch information
dataf3l committed Jul 12, 2019
0 parents commit ed44e2b
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
@@ -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

36 changes: 36 additions & 0 deletions g
@@ -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


0 comments on commit ed44e2b

Please sign in to comment.