We planned to upgrade GitLab and Mattermost to the latest version this Friday morning (early). You may experience some downtime!

Commit 8c9f32a0 authored by Bas Lijnse's avatar Bas Lijnse

Quick fix in broke toCanonicalPath

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@2568 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent b2fedb2c
......@@ -140,7 +140,7 @@ MAX_TIMEOUT :== 86400000 // one day
engine :: publish -> [(!String -> Bool
,!Bool
,!(HTTPRequest *IWorld -> (!HTTPResponse,!Maybe SessionId, !*IWorld))
,!(HTTPRequest (Maybe {#Char}) !SessionId *IWorld -> (!Maybe {#Char}, !Bool, !SessionId, !*IWorld))
,!(HTTPRequest (Maybe {#Char}) SessionId *IWorld -> (!Maybe {#Char}, !Bool, !SessionId, !*IWorld))
,!(HTTPRequest SessionId *IWorld -> *IWorld)
)] | Publishable publish
engine publishable
......@@ -263,8 +263,8 @@ where
// Determines the server executables path
determineAppPath :: !*World -> (!FilePath, !*World)
determineAppPath world
# ([arg:_],world) = getCommandLine world
| dropDirectory arg <> "ConsoleClient.exe" = toCanonicalPath arg world
# ([arg:_],world) = getCommandLine world
| dropDirectory arg <> "ConsoleClient.exe" = toCanonicalPath arg world
//Using dynamic linker:
# (res, world) = getCurrentDirectory world
| isError res = abort "Cannot get current directory."
......
implementation module iTasks.Framework.Util
import StdBool, StdList, StdFile, StdMisc, StdArray, StdString, StdTuple, StdFunc, StdGeneric, StdOrdList
import Data.Maybe, System.Time, Text, System.FilePath, System.Directory, Text.JSON, Data.Void, Data.Error, GenEq
import Data.Maybe, System.Time, System.OS, Text, System.FilePath, System.Directory, Text.JSON, Data.Void, Data.Error, GenEq
from iTasks.Framework.IWorld import :: IWorld{currentDateTime,timestamp}
from iTasks.API.Core.SystemTypes import :: Date{..}, :: Time{..}, :: DateTime(..)
......@@ -76,13 +76,15 @@ where
toCanonicalPath :: !FilePath !*World -> (!FilePath,!*World)
toCanonicalPath path world
= case split {pathSeparator} path of
["":ds] = (join {pathSeparator} ["":canonicalize ds],world)
ds = case getCurrentDirectory world of
(Ok curDir,world) = (join {pathSeparator} [curDir:canonicalize ds], world)
(_,world) = (join {pathSeparator} (canonicalize ds), world)
| isAbsolute path = (canonicalize path,world)
| otherwise
= case getCurrentDirectory world of
(Ok curDir,world) = (canonicalize (curDir</>path), world)
(_,world) = (canonicalize path,world)
where
canonicalize path = undot [] path
isAbsolute path = IF_POSIX_OR_WINDOWS (startsWith {pathSeparator}) (startsWith "C:" path)
canonicalize path = join {pathSeparator} (undot [] (split {pathSeparator} path))
undot acc [] = reverse acc
undot [] ["..":ds] = undot [] ds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment