cyberhobo
git push
and npm publish
for cyberhobos
Offline This module is gifted to cyberhobo extraordinaire, dominictarr.
features
- Run
git push
andnpm publish
while you're offline! - Next time you're online, all queued commands will run in order.
usage
- Install it globally.
npm install -g cyberhobo
- Set up bash/zsh aliases for
npm
andgit
socyberhobo
will run first.
alias git='cyberhobo git'alias npm='cyberhobo npm'
cyberhobo
will detect if you're offline and intercept git push
and npm publish
commands, queueing them to run later when you're back online. If you're online or
if you run a non push
/publish
command, then it will run normally.
#### when you're back online
If you're back in civilization and you have an internet connection, the next time you run
any git
or npm
command, cyberhobo
will run all the commands that were queued up
while you were offline. They will run in order.
If any of them fails with a non-zero exit code then cyberhobo
bails, printing out the remaining
commands so you can run them manually. (TODO)
example
$ touch test.txt$ git add test.txt # oh no! lost internet connection now. keep working... $ git commit -m "wrote some awesome code"[master 4f5f136] wrote some awesome code 1 file changed, 0 insertions, 0 deletions create mode 100644 test.txt $ git pushCYBER HOBO ACTIVATED! Command saved .Total 2 , reused 0 To git@github.com:feross/cyberhobo.git 1174974..4f5f136 master -> master ==== Running "npm publish" in /Users/feross/code/cyberhobo === npm http PUT https://registry.npmjs.org/cyberhobonpm http 201 https://registry.npmjs.org/cyberhobo+ cyberhobo@0.1.0 CYBER HOBO MISSION COMPLETE: all up to date On branch masterYour branch is up-to-date with 'origin/master'.
warning
This may be a horrible idea. I don't know.
license
MIT. Copyright Feross Aboukhadijeh.