Fix add hyper/karabiner config.

This commit is contained in:
Ivan Malison 2014-12-31 11:13:40 -05:00
parent 3fc4fa3aa5
commit b5ec409974

View File

@ -68,7 +68,6 @@ def packages(ctx):
def set_path_for_launchd(ctx): def set_path_for_launchd(ctx):
launch_agent_dir = os.path.expanduser('~/Library/LaunchAgents/') launch_agent_dir = os.path.expanduser('~/Library/LaunchAgents/')
filename = 'set-path.plist' filename = 'set-path.plist'
source = os.path.join(util.RESOURCES_DIRECTORY, filename) source = os.path.join(util.RESOURCES_DIRECTORY, filename)
destination = os.path.join(launch_agent_dir, filename) destination = os.path.join(launch_agent_dir, filename)
@ -104,13 +103,15 @@ def access_if_exists(ctx, app_string):
@ctask @ctask
def hyper(ctx): def hyper(ctx):
source = '{0}/karabiner-hyper.xml'.format(util.RESOURCES_DIRECTORY) source = '{0}/karabiner-hyper.xml'.format(util.RESOURCES_DIRECTORY)
destination = os.path.expanduser( destination_folder = os.path.join(
"~/Library/Application\\ Support/Karabiner/private.xml" os.path.expanduser("~/Library"), "Application\\ Support", "Karabiner"
) )
destination = os.path.join(destination_folder, "private.xml")
try: try:
ctx.run("rm {0}".format(destination)) ctx.run("rm {0}".format(destination))
except: except:
pass pass
util.ensure_path_exists(destination_folder)
ctx.run("ln -s {0} {1}".format(source, destination)) ctx.run("ln -s {0} {1}".format(source, destination))
ctx.run("{0}/karabiner_config.sh".format(util.RESOURCES_DIRECTORY)) ctx.run("{0}/karabiner_config.sh".format(util.RESOURCES_DIRECTORY))