git_aliases
Advanced tools
Comparing version 1.0.2 to 1.1.0
24
index.js
@@ -5,15 +5,31 @@ const { execSync } = require('child_process') | ||
co: 'checkout', | ||
cb: `"checkout -b"`, | ||
ca: `"checkout -a"`, | ||
br: 'branch', | ||
ci: 'commit', | ||
st: 'status', | ||
st: `"status -s"`, | ||
ft: 'fetch', | ||
pl: 'pull', | ||
ps: 'push' | ||
ps: 'push', | ||
ad: 'add .', | ||
cm: `"commit -m"`, | ||
in: 'init', | ||
lg: `"log --pretty='> %Cred%h %Creset| %Cgreen"%s"%Creset | %Cblue%an%Creset - %ar' -10"`, | ||
rv: `"remote -v"`, | ||
df: 'diff' | ||
} | ||
function execCmd (alias, to) { | ||
console.log('Executing', `"${alias}" ~> "${to}"`) | ||
execSync(['git', 'config', '--global', 'alias.' + alias, to].join(' ')) | ||
console.log('Executing', `${alias} ~> ${to}..`) | ||
execSync(['git', 'config', '--global', `alias.${alias}`, to].join(' ')) | ||
} | ||
console.log() | ||
console.log('Clearing alias section..') | ||
try { | ||
execSync(['git', 'config', '--global', '--remove-section', 'alias'].join(' ')) | ||
} catch (error) {} | ||
console.log() | ||
for (let alias in to) { | ||
@@ -20,0 +36,0 @@ execCmd(alias, to[alias]) |
{ | ||
"name": "git_aliases", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Create aliases for git commands", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "standard", | ||
"build": "pkg index.js --target node8-linux-x64,node8-macos-x64,node8-win-x64 --output output/git_aliases", | ||
@@ -9,0 +9,0 @@ "postinstall": "node index.js" |
@@ -0,1 +1,3 @@ | ||
[](https://nodei.co/npm/git_aliases/) | ||
# git_aliases | ||
@@ -5,9 +7,17 @@ Create aliases for git commands: | ||
``` | ||
"co" ~> "checkout" | ||
"br" ~> "branch" | ||
"ci" ~> "commit" | ||
"st" ~> "status" | ||
"ft" ~> "fetch" | ||
"pl" ~> "pull" | ||
"ps" ~> "push" | ||
co ~> checkout | ||
cb ~> "checkout -b" | ||
ca ~> "checkout -a" | ||
br ~> branch | ||
ci ~> commit | ||
st ~> "status -s" | ||
ft ~> fetch | ||
pl ~> pull | ||
ps ~> push | ||
ad ~> add . | ||
cm ~> "commit -m" | ||
in ~> init | ||
lg ~> "log --pretty='> %Cred%h %Creset| %Cgreen"%s"%Creset | %Cblue%an%Creset - %ar' -10" | ||
rv ~> "remote -v" | ||
df ~> diff | ||
``` | ||
@@ -19,2 +29,2 @@ | ||
`npm i git_aliases` | ||
`npm i -g git_aliases` |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
4944
5
47
0
29