From 1a52e4255560adb152c02a33ec72da911eb25e01 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sat, 19 Nov 2016 16:37:44 -0800 Subject: [PATCH] Improve readme wording, == -> is, wrap to 80 characters, use 4 space indentation --- README.md | 4 +++- plugins/link.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 909b4d9..25cff54 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,9 @@ symbolic link should have a relative path. path: zshrc ``` -If the source location is omitted or NULL, dotbot will use the destination instead, without a leading `.` if present. This makes the following three config files equivalent: +If the source location is omitted or set to `null`, Dotbot will use the +basename of the destination, with a leading `.` stripped if present. This makes +the following three config files equivalent: ```yaml - link: diff --git a/plugins/link.py b/plugins/link.py index 44a865e..ee64175 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -47,14 +47,14 @@ class Link(dotbot.Plugin): return success def _default_source(self, destination, source): - if source == None: - basename = os.path.basename(destination) - if basename.startswith('.'): - return basename[1:] - else: - return basename - else: - return source + if source is None: + basename = os.path.basename(destination) + if basename.startswith('.'): + return basename[1:] + else: + return basename + else: + return source def _is_link(self, path): '''