From b5ec409974f6f840f6f5c533125165ace02a6827 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 31 Dec 2014 11:13:40 -0500 Subject: [PATCH] Fix add hyper/karabiner config. --- tasks/osx.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/osx.py b/tasks/osx.py index e67766b3..add014d8 100644 --- a/tasks/osx.py +++ b/tasks/osx.py @@ -68,7 +68,6 @@ def packages(ctx): def set_path_for_launchd(ctx): launch_agent_dir = os.path.expanduser('~/Library/LaunchAgents/') filename = 'set-path.plist' - source = os.path.join(util.RESOURCES_DIRECTORY, filename) destination = os.path.join(launch_agent_dir, filename) @@ -104,13 +103,15 @@ def access_if_exists(ctx, app_string): @ctask def hyper(ctx): source = '{0}/karabiner-hyper.xml'.format(util.RESOURCES_DIRECTORY) - destination = os.path.expanduser( - "~/Library/Application\\ Support/Karabiner/private.xml" + destination_folder = os.path.join( + os.path.expanduser("~/Library"), "Application\\ Support", "Karabiner" ) + destination = os.path.join(destination_folder, "private.xml") try: ctx.run("rm {0}".format(destination)) except: pass + util.ensure_path_exists(destination_folder) ctx.run("ln -s {0} {1}".format(source, destination)) ctx.run("{0}/karabiner_config.sh".format(util.RESOURCES_DIRECTORY))