Skip to content

Instantly share code, notes, and snippets.

@donpark
Created August 28, 2012 01:07
Show Gist options
  • Save donpark/3494038 to your computer and use it in GitHub Desktop.
Save donpark/3494038 to your computer and use it in GitHub Desktop.
fabric/python script for launching node-inspector
import os
import time
def terminal(cmd):
local("osascript -e 'tell application \"Terminal\" to do script \"%s\"'" % cmd)
def debugger(opts):
url = "http://0.0.0.0:8080/debug?port=5858"
build()
terminal("node %(opts)s %(cwd)s/app.js" % { "opts": opts, "cwd": os.getcwd() })
time.sleep(1)
terminal("node-inspector")
time.sleep(1)
local("open -a Safari %s" % url)
def debug():
debugger("--debug")
def debugbreak():
debugger("--debug-brk")
@donpark
Copy link
Author

donpark commented Aug 28, 2012

Adjust first time.sleep delay as needed if your app takes longer to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment