mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
fix .env support
This commit is contained in:
parent
94afeb406a
commit
b93c6cd48b
|
@ -2,6 +2,9 @@
|
|||
// https://github.com/gnh1201/welsonjs
|
||||
var SYS = require("lib/system");
|
||||
|
||||
// env
|
||||
var env = {};
|
||||
|
||||
function main(args) {
|
||||
console.log("WelsonJS.Service required.");
|
||||
}
|
||||
|
@ -11,7 +14,14 @@ function getDeviceID() {
|
|||
}
|
||||
|
||||
function onServiceStart(args) {
|
||||
return "onServiceStart recevied. " + args.join(', ');
|
||||
// load the environment file
|
||||
FILE.loadEnvFromArgs(args, function(envConfig) {
|
||||
if ("message" in envConfig) {
|
||||
env.message = envConfig.message;
|
||||
}
|
||||
});
|
||||
|
||||
return "onServiceStart recevied. " + args.join(', ') + ", env: " + JSON.stringify(env);
|
||||
}
|
||||
|
||||
function onServiceStop() {
|
||||
|
|
|
@ -543,6 +543,7 @@ global.splitLn = splitLn;
|
|||
global.addslashes = addslashes;
|
||||
global.AsyncFunction = AsyncFunction;
|
||||
global.GeneratorFunction = GeneratorFunction;
|
||||
global.parseEnv = parseEnv;
|
||||
|
||||
exports.Event = StdEvent;
|
||||
exports.EventTarget = StdEventTarget;
|
||||
|
@ -551,7 +552,7 @@ exports.Storage = StdStorage;
|
|||
exports.alert = alert;
|
||||
exports.confirm = confirm;
|
||||
|
||||
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.11";
|
||||
exports.VERSIONINFO = "WelsonJS Standard Library (std.js) version 0.8.12";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user