/* CD-env.cmd
 *
 * set up the environment for Suntan Special
 * add cdutils to the path
 * set temp in the environment (disabled, 2008)
 *
 * Copyright (C) 2001 Blonde Guy
 * All Rights Reserved
 */

originalDir = Directory()

Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
Call SysLoadFuncs

/* add current directory to system path if it isn't there */
systemPath = value('PATH',,'OS2ENVIRONMENT')
if right(systemPath,1) \= ';' then do
   systemPath = systemPath || ';'
end
utilPath = Directory()
if pos(utilPath, systemPath) = 0 then do
  systemPath = systemPath || utilPath
  call value "PATH", systemPath, "OS2ENVIRONMENT"
end

/* ensure tempdir is set (disabled, 2008)
TempDir = value('TEMP',,'OS2ENVIRONMENT')
if TempDir = '' then do
   TempDir = cdglobal('tempDir')   
   if directory(TempDir) = '' then do
      call LogCdi "Creating" TempDir
      call SysMkDir TempDir
   end
   call value 'TEMP', TempDir, 'OS2ENVIRONMENT'
end
*/
call Directory originalDir

return
