Skip to content

Commit

Permalink
MS Windows: Avoid // in path #225
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 19, 2020
1 parent 5e25a47 commit b94f0c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ convertpath() { # convert unix and windows pathes
# $1: Mode:
# windows echo Windows path - result: c:/path
# unix echo unix path - result: /c/path
# subsystem echo path within subsystem - result: /cygdrive/c/path or /path
# subsystem echo path within subsystem - result: /cygdrive/c/path or /path or /mnt/c/path
# volume echo --volume compatible syntax - result: 'unixpath':'containerpath':rw (or ":ro")
# container echo path of volume in container - result: /path
# share echo path of $Sharefolder/file in container - result: /containerpath
Expand All @@ -956,11 +956,11 @@ convertpath() { # convert unix and windows pathes
# replace ~ with HOME
Path="$(sed s%"~"%"${Hostuserhome:-${HOME:-}}"% <<< "$Path")"

# share: Replace $Sharefolder with $Cshare
# share: Replace $Sharefolder with $Sharefoldercontainer
[ "$Mode" = "share" ] && {
[ -z "$Path" ] && echo "" && return 0
case $X11dockermode in
run) echo "${Cshare}${Path#$Sharefolder}" ;;
run) echo "${Sharefoldercontainer}${Path#$Sharefolder}" ;;
exe) echo "$Path" ;;
esac
return 0
Expand Down Expand Up @@ -3988,7 +3988,7 @@ create_dockercommand() { ### create command to run docker

# shared cache folder
Dockercommand="$Dockercommand \\
--volume $(convertpath volume "$Sharefolder:rw" $Cshare)"
--volume $(convertpath volume "$Sharefolder:rw" $Sharefoldercontainer)"

# --home, --homedir
[ "$Sharehosthome" = "yes" ] && [ -n "$Containeruserhosthome" ] && Dockercommand="$Dockercommand \\
Expand Down Expand Up @@ -6098,6 +6098,7 @@ check_host() { # check host environment
;;
esac
[ "$Winsubsystem" ] && Hostsystem="MSWindows-$Winsubsystem"
Winsubmount="${Winsubmount%/}"

[ -z "$Mobyvm" ] && Mobyvm="no"
case $Mobyvm in
Expand Down Expand Up @@ -7704,8 +7705,8 @@ declare_variables() { # declare global variables
# Cache folders
Cachebasefolder="" # --cachebasedir Base cache folder
Cachefolder="" # Subfolder of $Cachebasefolder for current container
Cshare="/x11docker" # Mountpoint of $Sharefolder in container
Sharefolder="share" # Subfolder of $Cachefolder for cache files shared with container
Sharefoldercontainer="/x11docker" # Mountpoint of $Sharefolder in container

# stdin stdout stderr
Cmdstdinfifo="stdin" # stdin for container command. fifo/named pipe to forward stdin of x11docker to container command
Expand Down

0 comments on commit b94f0c2

Please sign in to comment.