ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Retrieving original value of enviroment variable HOME
@ 2020-05-06 15:43 context
  2020-05-07  6:54 ` Hans Hagen
  0 siblings, 1 reply; 18+ messages in thread
From: context @ 2020-05-06 15:43 UTC (permalink / raw)
  To: ConTeXt

Hello,

before I run ConTeXt, I set a (new) variable "HOME" to point to a 
particular directory.

ConTeXt changes its value during startup - it sets its value to 
%USERPROFILE% - I guess it is to unify environment somehow for all 
platforms ConTeXt supports; probably here:

---- data-ini.lua, ln. ~86
do

     local homedir = osgetenv(ostype == "windows" and 'USERPROFILE' or 
'HOME') or ''

     if not homedir or homedir == "" then
         homedir = char(127) -- we need a value, later we wil trigger on 
it
     end

     homedir = file.collapsepath(homedir)

     ossetenv("HOME",       homedir) -- can be used in unix cnf files 
<<<<<<<<<<<<<< HERE
     ossetenv("USERPROFILE",homedir) -- can be used in windows cnf files

     environment.homedir = homedir

end
----

But anyway - would it be possible to store the original value of HOME 
environment variable (if set) before it gets changed during 
initialization - e.g. to a Lua table?

- I would need to work with the original value in run-time (Win7 / WinX; 
ConTeXt MkIV).

Best regards,

Lukas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-05-14  7:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 15:43 Retrieving original value of enviroment variable HOME context
2020-05-07  6:54 ` Hans Hagen
2020-05-07 10:30   ` context
2020-05-08 12:18     ` Hans Hagen
2020-05-10 12:33       ` context
2020-05-10 15:20         ` Hans Hagen
2020-05-11  7:44           ` context
2020-05-11  8:51             ` Hans Hagen
2020-05-11 10:50               ` context
2020-05-11 10:54                 ` Henning Hraban Ramm
2020-05-11 13:36                   ` Henning Hraban Ramm
2020-05-11 10:58                 ` Marco Patzer
2020-05-11 15:20                   ` context
2020-05-11 15:57               ` context
2020-05-12  8:53                 ` Hans Hagen
2020-05-12  9:36                   ` context
2020-05-12 11:53                     ` Hans Hagen
2020-05-14  7:47                       ` context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).