prosody: Add prosody.platform which can be either 'windows', 'posix' or 'unknown'

Sat, 19 Sep 2009 11:17:30 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 19 Sep 2009 11:17:30 +0100
changeset 1789
23a66fdf541e
parent 1788
45779d67c26c
child 1790
f06688f9b6c6

prosody: Add prosody.platform which can be either 'windows', 'posix' or 'unknown'

prosody file | annotate | diff | comparison | revisions
--- a/prosody	Fri Sep 18 02:48:52 2009 +0100
+++ b/prosody	Sat Sep 19 11:17:30 2009 +0100
@@ -93,6 +93,12 @@
 
 	prosody.events = require "util.events".new();
 	
+	prosody.platform = "unknown";
+	if os.getenv("WINDIR") then
+		prosody.platform = "windows";
+	elseif package.config:sub(1,1) == "/" then
+		prosody.platform = "posix";
+	end
 	
 	-- Function to reload the config file
 	function prosody.reload_config()

mercurial