# Path: revolver/contextmanager.py
# def sudo(username=None, login=False):
# def unpatched_state():
# 
# Path: revolver/directory.py
# def temp_local():
# def temp(mode=None, owner=None, group=None):
# def remove(location, recursive=False, force=True):
# def create(path, recursive=False, mode=None, owner=None, group=None):
# 
# Path: revolver/file.py
# def temp(mode=None, owner=None, group=None):
# def remove(location, recursive=False, force=True):
# def touch(location, mode=None, owner=None, group=None):
# def copy(source, destination, force=True, mode=None, owner=None, group=None):
# 
# Path: revolver/git.py
# def repository_name():
# def create_archive(revision):
# def revparse(revision):
# 
# Path: revolver/core.py
# VERSION = '0.0.5'
# def put(*args, **kwargs):
# def run(*args, **kwargs):
# def sudo(*args, **kwargs):
# 
# Path: revolver/command.py

# 
# Path: revolver/service.py
# def add_upstart(name, content):
# def command(name, command):
# def start(name):
# def stop(name):
# def restart(name):
# def reload(name):
# def is_running(name):


from datetime import datetime
from revolver import contextmanager as ctx
from revolver import directory as dir
from revolver import file, git, core, command, service
import posixpath
        for src, dst in self._shares:
            dst = dst % self.folders

            dir.ensure(posixpath.dirname(src), recursive=True)
            dir.remove(src, recursive=True)
            dir.ensure(dst, recursive=True)
            file.link(dst, src)


class AutoDependencyHook(BaseHook):
    def on_after_upload(self):
        self.dispatch_hook("before_dependencies")
        self._dependencies()
        self.dispatch_hook("after_dependencies")

    def _dependencies(self):
        with ctx.cd(self.folders["releases.current"]):
            if file.exists("package.json"):
                self._dependencies_package_json()

            if file.exists("Gemfile"):
                self._dependencies_gemfile()

            if file.exists("setup.py"):
                self._dependencies_setup_py()

            if file.exists("requirements.txt"):
                self._dependencies_requirements_txt()

    def _dependencies_package_json(self):

# Path: revolver/contextmanager.py
# def sudo(username=None, login=False):
# def unpatched_state():
# 
# Path: revolver/directory.py
# def temp_local():
# def temp(mode=None, owner=None, group=None):
# def remove(location, recursive=False, force=True):
# def create(path, recursive=False, mode=None, owner=None, group=None):
# 
# Path: revolver/file.py
# def temp(mode=None, owner=None, group=None):
# def remove(location, recursive=False, force=True):
# def touch(location, mode=None, owner=None, group=None):
# def copy(source, destination, force=True, mode=None, owner=None, group=None):
# 
# Path: revolver/git.py
# def repository_name():
# def create_archive(revision):
# def revparse(revision):
# 
# Path: revolver/core.py
# VERSION = '0.0.5'
# def put(*args, **kwargs):
# def run(*args, **kwargs):
# def sudo(*args, **kwargs):
# 
# Path: revolver/command.py

# 
# Path: revolver/service.py
# def add_upstart(name, content):
# def command(name, command):
# def start(name):
# def stop(name):
# def restart(name):
# def reload(name):
# def is_running(name):


# Path: revolver/project.py
from datetime import datetime
from revolver import contextmanager as ctx
from revolver import directory as dir
from revolver import file, git, core, command, service
import posixpath

        for src, dst in self._shares:
            dst = dst % self.folders

            dir.ensure(posixpath.dirname(src), recursive=True)
            dir.remove(src, recursive=True)
            dir.ensure(dst, recursive=True)
            file.link(dst, src)


class AutoDependencyHook(BaseHook):
    def on_after_upload(self):
        self.dispatch_hook("before_dependencies")
        self._dependencies()
        self.dispatch_hook("after_dependencies")

    def _dependencies(self):
        with ctx.cd(self.folders["releases.current"]):
            if file.exists("package.json"):
                self._dependencies_package_json()

            if file.exists("Gemfile"):
                self._dependencies_gemfile()

            if file.exists("setup.py"):
                self._dependencies_setup_py()

            if file.exists("requirements.txt"):
                self._dependencies_requirements_txt()

    def _dependencies_package_json(self):

        if command.exists("npm"):