|
|
@ -2,11 +2,18 @@
|
|
|
|
var
|
|
|
|
var
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
originalUrl,
|
|
|
|
originalUrl,
|
|
|
|
|
|
|
|
scriptDir,
|
|
|
|
|
|
|
|
scriptPath = require('fs').absolute(require('system').args[0]),
|
|
|
|
resourceTimeout = 9000,
|
|
|
|
resourceTimeout = 9000,
|
|
|
|
args = [],
|
|
|
|
args = [],
|
|
|
|
debug = false;
|
|
|
|
debug = false;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
// Working directory
|
|
|
|
|
|
|
|
scriptDir = scriptPath.split('/'); scriptDir.pop(); scriptDir = scriptDir.join('/');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('fs').changeWorkingDirectory(scriptDir);
|
|
|
|
|
|
|
|
|
|
|
|
require('system').args.forEach(function(arg) {
|
|
|
|
require('system').args.forEach(function(arg) {
|
|
|
|
switch ( arg ) {
|
|
|
|
switch ( arg ) {
|
|
|
|
case '-v':
|
|
|
|
case '-v':
|
|
|
|