source: Dev/trunk/src/client/util/build/rhino/process.js @ 529

Last change on this file since 529 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 884 bytes
Line 
1define([], function() {
2        return {
3                cwd:function() {
4                        return environment["user.dir"];
5                },
6
7                exit:function(resultCode) {
8                        // no documented way to return an exit code in rhino
9                        if (resultCode) {
10                                java.lang.System.exit(resultCode);
11                        }
12                        quit();
13                },
14
15                exec:function() {
16                        // signature is (command, arg1, ..., argn, errorMessage, bc, callback)
17                        for(var args = [], i = 0; i<arguments.length-3; i++){
18                                args.push(arguments[i]);
19                        }
20                        var
21                                errorMessage = arguments[i++],
22                                bc = arguments[i++],
23                                callback = arguments[i],
24                                options = {output:""};
25                        args.push(options);
26                        try{
27                                runCommand.apply(this, args);
28                                callback && callback(0, options.output);
29                        }catch(e){
30                                bc.log("execFailed", ["message", errorMessage, "output", options.output+"", "error", e]);
31                                callback && callback(-1, errorMessage + "\n" + options.output + "\n" + e);
32                        }
33                }
34        };
35});
Note: See TracBrowser for help on using the repository browser.