diff --git a/dotbot/cli.py b/dotbot/cli.py index 2680acf..77bd439 100644 --- a/dotbot/cli.py +++ b/dotbot/cli.py @@ -73,10 +73,10 @@ def main(): if not isinstance(tasks, list): raise ReadingError('Configuration file must be a list of tasks') if options.base_directory: - base_directory = options.base_directory + base_directory = os.path.abspath(options.base_directory) else: # default to directory of config file - base_directory = os.path.dirname(os.path.realpath(options.config_file)) + base_directory = os.path.dirname(os.path.abspath(options.config_file)) os.chdir(base_directory) dispatcher = Dispatcher(base_directory) success = dispatcher.dispatch(tasks) diff --git a/test/tests/link-canonicalize.bash b/test/tests/link-canonicalize.bash new file mode 100644 index 0000000..34015c8 --- /dev/null +++ b/test/tests/link-canonicalize.bash @@ -0,0 +1,20 @@ +test_description='linking canonicalizes path by default' +. '../test-lib.bash' + +test_expect_success 'setup' ' +echo "apple" > ${DOTFILES}/f && +ln -s dotfiles dotfiles-symlink +' + +test_expect_success 'run' ' +cat > "${DOTFILES}/${INSTALL_CONF}" < ${DOTFILES}/f && +ln -s dotfiles dotfiles-symlink +' + +test_expect_success 'run' ' +cat > "${DOTFILES}/${INSTALL_CONF}" <