From: W. Trevor King Date: Thu, 13 Mar 2014 02:21:57 +0000 (-0700) Subject: swc-windows-installer.py: Use POSIX paths for ~/nano.rc X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee9a596188011c912ca12686a5fb35431a613a68;p=swc-workshop.git swc-windows-installer.py: Use POSIX paths for ~/nano.rc On Wed, Mar 12, 2014 at 06:34:43PM -0700, Ethan White wrote [1]: > The bash script in #228 is now working properly, but the Python > script is still failing. It reports errors like: > > Error reading ~\.swc\share\nanorc\doc\syntax\python.nanorc > > The obvious difference is that the nano.rc files produced by the > bash script have `/` for paths for the includes, but the Python > script produces includes that use `\`. [1]: https://github.com/swcarpentry/bc/pull/357#issuecomment-37491038 --- diff --git a/swc-windows-installer.py b/swc-windows-installer.py index fe7af74..3fee893 100755 --- a/swc-windows-installer.py +++ b/swc-windows-installer.py @@ -132,7 +132,7 @@ def install_nanorc(install_directory): if filename.endswith('.nanorc'): path = os.path.join(syntax_dir, filename) rel_path = os.path.relpath(path, home) - include_path = os.path.join('~', rel_path) + include_path = make_posix_path(os.path.join('~', rel_path)) f.write('include {}\n'.format(include_path))