Permalink
Browse files

Double escape thor root for windows.

  • Loading branch information...
1 parent a5483ac commit 1f119d15bc0bd38823b65a31c361e1b5c3b16e94 @josevalim josevalim committed Oct 18, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/thor/util.rb
View
@@ -209,7 +209,7 @@ def self.user_home
# Returns the root where thor files are located, dependending on the OS.
#
def self.thor_root
- File.join(user_home, ".thor")
+ File.join(user_home, ".thor").gsub(/\\/, '/')
end
# Returns the files in the thor root. On Windows thor_root will be something
@@ -220,7 +220,7 @@ def self.thor_root
# If we don't #gsub the \ character, Dir.glob will fail.
#
def self.thor_root_glob
- files = Dir["#{thor_root.gsub(/\\/, '/')}/*"]
+ files = Dir["#{thor_root}/*"]
files.map! do |file|
File.directory?(file) ? File.join(file, "main.thor") : file

0 comments on commit 1f119d1

Please sign in to comment.