lib/sct/docker/docker.rb in sct-0.1.7 vs lib/sct/docker/docker.rb in sct-0.1.8
- old
+ new
@@ -59,11 +59,11 @@
###
def self.setPwdAsVolume(volume_path)
pwd = `pwd -P`
if Sct::Config.operatingSystem == Sct::Config::WINDOWS
- pwd=self.convertPath(pwd)
+ pwd=Sct::Config.convertWSLToWindowsPath(pwd)
end
addVolume(pwd, volume_path)
end
@@ -195,31 +195,8 @@
###
# Append a part to the command string and remove any unwanted characters
###
def self.addToCommandString(command_string, append)
return command_string + append.gsub(/\r?\n/, "") + " "
- end
-
- ###
- # Get the actual home path of the user. This may be different depending on the operating system
- ###
- def self.getTrueHomePath
- home_path = `echo ~`
- if Sct::Config.operatingSystem == Sct::Config::WINDOWS
- home_path = self.convertPath(`cmd.exe /c echo %userprofile%`, false)
- end
-
- return home_path
- end
-
- ###
- # Convert the unix paths to Windows paths for Windows systems
- ###
- def self.convertPath(path, to_native=true)
- if Sct::Config.operatingSystem == Sct::Config::WINDOWS && to_native
- return path.gsub(/\/mnt\/c/, 'C:/').gsub(/\/\//, '/').gsub(/\\\\/, "/").gsub(/\r\n?/, '')
- else
- return path.gsub(/C:\\/, '/mnt/c').gsub(/\\\\/, "/").gsub(/\\/, '/').gsub(/\r\n?/, '')
- end
end
end
end