Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E2A411519 for ; Fri, 5 Sep 2014 22:46:44 +0000 (UTC) Received: (qmail 20181 invoked by uid 500); 5 Sep 2014 22:46:44 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 20069 invoked by uid 500); 5 Sep 2014 22:46:44 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 19869 invoked by uid 99); 5 Sep 2014 22:46:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2014 22:46:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AAD1CA0B7CC; Fri, 5 Sep 2014 22:46:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: commits@cordova.apache.org Date: Fri, 05 Sep 2014 22:46:47 -0000 Message-Id: <36b5f53f0b2847b880beadcf3dff58e0@git.apache.org> In-Reply-To: <0972d7fc530f48c9b99d6f6827a99930@git.apache.org> References: <0972d7fc530f48c9b99d6f6827a99930@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/26] Moves node_modules from package root to bin/ folder http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/echo.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/echo.js b/wp8/node_modules/shelljs/test/echo.js deleted file mode 100644 index 82faa51..0000000 --- a/wp8/node_modules/shelljs/test/echo.js +++ /dev/null @@ -1,50 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'), - child = require('child_process'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - - -// From here on we use child.exec() to intercept the stdout - - -// simple test with defaults -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); echo("-asdf", "111");'; // test '-' bug (see issue #20) -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout === '-asdf 111\n' || stdout === '-asdf 111\nundefined\n'); // 'undefined' for v0.4 - - // simple test with silent(true) - shell.mkdir('-p', 'tmp'); - var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; echo(555);'; - script.to(file); - child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout === '555\n' || stdout === '555\nundefined\n'); // 'undefined' for v0.4 - - theEnd(); - }); -}); - -function theEnd() { - shell.exit(123); -} http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/env.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/env.js b/wp8/node_modules/shelljs/test/env.js deleted file mode 100644 index 0e041d6..0000000 --- a/wp8/node_modules/shelljs/test/env.js +++ /dev/null @@ -1,19 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'); - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -assert.equal(shell.env['PATH'], process.env['PATH']); - -shell.env['SHELLJS_TEST'] = 'hello world'; -assert.equal(shell.env['SHELLJS_TEST'], process.env['SHELLJS_TEST']); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/exec.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/exec.js b/wp8/node_modules/shelljs/test/exec.js deleted file mode 100644 index e721808..0000000 --- a/wp8/node_modules/shelljs/test/exec.js +++ /dev/null @@ -1,109 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'), - util = require('util'), - child = require('child_process'); - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// -// Invalids -// - -shell.exec(); -assert.ok(shell.error()); - -var result = shell.exec('asdfasdf'); // could not find command -assert.ok(result.code > 0); - - -// -// Valids -// - -// -// sync -// - -// check if stdout goes to output -var result = shell.exec('node -e \"console.log(1234);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 - -// check if stderr goes to output -var result = shell.exec('node -e \"console.error(1234);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 - -// check if stdout + stderr go to output -var result = shell.exec('node -e \"console.error(1234); console.log(666);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n666\n' || result.output === '1234\n666\nundefined\n'); // 'undefined' for v0.4 - -// check exit code -var result = shell.exec('node -e \"process.exit(12);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 12); - -// interaction with cd -shell.cd('resources/external'); -var result = shell.exec('node node_script.js'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.equal(result.output, 'node_script_1234\n'); -shell.cd('../..'); - -// check quotes escaping -var result = shell.exec( util.format('node -e "console.log(%s);"', "\\\"\\'+\\'_\\'+\\'\\\"") ); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.equal(result.output, "'+'_'+'\n"); - -// -// async -// - -// no callback -var c = shell.exec('node -e \"console.log(1234)\"', {async:true}); -assert.equal(shell.error(), null); -assert.ok('stdout' in c, 'async exec returns child process object'); - -// -// callback as 2nd argument -// -shell.exec('node -e \"console.log(5678);\"', function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 - - // - // callback as 3rd argument - // - shell.exec('node -e \"console.log(5566);\"', {async:true}, function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5566\n' || output === '5566\nundefined\n'); // 'undefined' for v0.4 - - // - // callback as 3rd argument (slient:true) - // - shell.exec('node -e \"console.log(5678);\"', {silent:true}, function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 - - shell.exit(123); - - }); - - }); - -}); - -assert.equal(shell.error(), null); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/find.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/find.js b/wp8/node_modules/shelljs/test/find.js deleted file mode 100644 index d375f86..0000000 --- a/wp8/node_modules/shelljs/test/find.js +++ /dev/null @@ -1,56 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -var result = shell.find(); // no paths given -assert.ok(shell.error()); - -// -// Valids -// - -// current path -shell.cd('resources/find'); -var result = shell.find('.'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('.hidden') > -1, true); -assert.equal(result.indexOf('dir1/dir11/a_dir11') > -1, true); -assert.equal(result.length, 11); -shell.cd('../..'); - -// simple path -var result = shell.find('resources/find'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/.hidden') > -1, true); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.length, 11); - -// multiple paths - comma -var result = shell.find('resources/find/dir1', 'resources/find/dir2'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); -assert.equal(result.length, 6); - -// multiple paths - array -var result = shell.find(['resources/find/dir1', 'resources/find/dir2']); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); -assert.equal(result.length, 6); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/grep.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/grep.js b/wp8/node_modules/shelljs/test/grep.js deleted file mode 100644 index 71db982..0000000 --- a/wp8/node_modules/shelljs/test/grep.js +++ /dev/null @@ -1,59 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.grep(); -assert.ok(shell.error()); - -shell.grep(/asdf/g); // too few args -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.grep(/asdf/g, '/asdfasdf'); // no such file -assert.ok(shell.error()); - -// -// Valids -// - -var result = shell.grep('line', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result.split('\n').length - 1, 4); - -var result = shell.grep('-v', 'line', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result.split('\n').length - 1, 8); - -var result = shell.grep('line one', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result, 'This is line one\n'); - -// multiple files -var result = shell.grep(/test/, 'resources/file1.txt', 'resources/file2.txt'); -assert.equal(shell.error(), null); -assert.equal(result, 'test1\ntest2\n'); - -// multiple files, array syntax -var result = shell.grep(/test/, ['resources/file1.txt', 'resources/file2.txt']); -assert.equal(shell.error(), null); -assert.equal(result, 'test1\ntest2\n'); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/ls.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/ls.js b/wp8/node_modules/shelljs/test/ls.js deleted file mode 100644 index 5067b7d..0000000 --- a/wp8/node_modules/shelljs/test/ls.js +++ /dev/null @@ -1,202 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -var result = shell.ls('/asdfasdf'); // no such file or dir -assert.ok(shell.error()); -assert.equal(result.length, 0); - -// -// Valids -// - -var result = shell.ls(); -assert.equal(shell.error(), null); - -var result = shell.ls('/'); -assert.equal(shell.error(), null); - -// no args -shell.cd('resources/ls'); -var result = shell.ls(); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.length, 6); -shell.cd('../..'); - -// simple arg -var result = shell.ls('resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.length, 6); - -// no args, 'all' option -shell.cd('resources/ls'); -var result = shell.ls('-A'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('.hidden_file') > -1, true); -assert.equal(result.indexOf('.hidden_dir') > -1, true); -assert.equal(result.length, 8); -shell.cd('../..'); - -// no args, 'all' option -shell.cd('resources/ls'); -var result = shell.ls('-a'); // (deprecated) backwards compatibility test -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('.hidden_file') > -1, true); -assert.equal(result.indexOf('.hidden_dir') > -1, true); -assert.equal(result.length, 8); -shell.cd('../..'); - -// wildcard, simple -var result = shell.ls('resources/ls/*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/file1') > -1, true); -assert.equal(result.indexOf('resources/ls/file2') > -1, true); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir') > -1, true); -assert.equal(result.length, 6); - -// wildcard, hidden only -var result = shell.ls('resources/ls/.*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/.hidden_file') > -1, true); -assert.equal(result.indexOf('resources/ls/.hidden_dir') > -1, true); -assert.equal(result.length, 2); - -// wildcard, mid-file -var result = shell.ls('resources/ls/f*le*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 5); -assert.equal(result.indexOf('resources/ls/file1') > -1, true); -assert.equal(result.indexOf('resources/ls/file2') > -1, true); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); - -// wildcard, mid-file with dot (should escape dot for regex) -var result = shell.ls('resources/ls/f*le*.js'); -assert.equal(shell.error(), null); -assert.equal(result.length, 2); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); - -// wildcard, should not do partial matches -var result = shell.ls('resources/ls/*.j'); // shouldn't get .js -assert.equal(shell.error(), null); -assert.equal(result.length, 0); - -// wildcard, all files with extension -var result = shell.ls('resources/ls/*.*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 3); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); - -// wildcard, with additional path -var result = shell.ls('resources/ls/f*le*.js', 'resources/ls/a_dir'); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('b_dir') > -1, true); // no wildcard == no path prefix -assert.equal(result.indexOf('nada') > -1, true); // no wildcard == no path prefix - -// wildcard for both paths -var result = shell.ls('resources/ls/f*le*.js', 'resources/ls/a_dir/*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/nada') > -1, true); - -// wildcard for both paths, array -var result = shell.ls(['resources/ls/f*le*.js', 'resources/ls/a_dir/*']); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/nada') > -1, true); - -// recursive, no path -shell.cd('resources/ls'); -var result = shell.ls('-R'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); -shell.cd('../..'); - -// recusive, path given -var result = shell.ls('-R', 'resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); - -// recusive, path given - 'all' flag -var result = shell.ls('-RA', 'resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.indexOf('a_dir/.hidden_dir/nada') > -1, true); -assert.equal(result.length, 14); - -// recursive, wildcard -var result = shell.ls('-R', 'resources/ls/*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/a_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/make.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/make.js b/wp8/node_modules/shelljs/test/make.js deleted file mode 100644 index 3edbd8c..0000000 --- a/wp8/node_modules/shelljs/test/make.js +++ /dev/null @@ -1,20 +0,0 @@ -var shell = require('..'), - child = require('child_process'), - assert = require('assert'); - -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../make.js\');' + - 'target.all=function(){' + - ' echo("first"); '+ - ' cp("this_file_doesnt_exist", ".");' + - ' echo("second");' + - '}'; - -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout.match('first')); - assert.ok(!stdout.match('second')); // Make should die on errors, so this should never get echoed - - shell.exit(123); -}); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/mkdir.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/mkdir.js b/wp8/node_modules/shelljs/test/mkdir.js deleted file mode 100644 index 1f93422..0000000 --- a/wp8/node_modules/shelljs/test/mkdir.js +++ /dev/null @@ -1,79 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.mkdir(); -assert.ok(shell.error()); - -var mtime = fs.statSync('tmp').mtime.toString(); -shell.mkdir('tmp'); // dir already exists -assert.ok(shell.error()); -assert.equal(fs.statSync('tmp').mtime.toString(), mtime); // didn't mess with dir - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.mkdir('/asdfasdf/asdfasdf'); // root path does not exist -assert.ok(shell.error()); -assert.equal(fs.existsSync('/asdfasdf'), false); - -// -// Valids -// - -assert.equal(fs.existsSync('tmp/t1'), false); -shell.mkdir('tmp/t1'); // simple dir -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/t1'), true); - -assert.equal(fs.existsSync('tmp/t2'), false); -assert.equal(fs.existsSync('tmp/t3'), false); -shell.mkdir('tmp/t2', 'tmp/t3'); // multiple dirs -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/t2'), true); -assert.equal(fs.existsSync('tmp/t3'), true); - -assert.equal(fs.existsSync('tmp/t1'), true); -assert.equal(fs.existsSync('tmp/t4'), false); -shell.mkdir('tmp/t1', 'tmp/t4'); // one dir exists, one doesn't -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/t1'), true); -assert.equal(fs.existsSync('tmp/t4'), true); - -assert.equal(fs.existsSync('tmp/a'), false); -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', 'tmp/a'); // revert - -// multiple dirs -shell.mkdir('-p', 'tmp/zzza', 'tmp/zzzb', 'tmp/zzzc'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/zzza'), true); -assert.equal(fs.existsSync('tmp/zzzb'), true); -assert.equal(fs.existsSync('tmp/zzzc'), true); - -// multiple dirs, array syntax -shell.mkdir('-p', ['tmp/yyya', 'tmp/yyyb', 'tmp/yyyc']); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/yyya'), true); -assert.equal(fs.existsSync('tmp/yyyb'), true); -assert.equal(fs.existsSync('tmp/yyyc'), true); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/mv.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/mv.js b/wp8/node_modules/shelljs/test/mv.js deleted file mode 100644 index 89bca91..0000000 --- a/wp8/node_modules/shelljs/test/mv.js +++ /dev/null @@ -1,130 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// Prepare tmp/ -shell.cp('resources/*', 'tmp'); - -// -// Invalids -// - -shell.mv(); -assert.ok(shell.error()); - -shell.mv('file1'); -assert.ok(shell.error()); - -shell.mv('-f'); -assert.ok(shell.error()); - -shell.mv('-Z', 'tmp/file1', 'tmp/file1'); // option not supported -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), true); - -shell.mv('asdfasdf', 'tmp'); // source does not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/asdfasdf'), false); - -shell.mv('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 2); -assert.equal(fs.existsSync('tmp/asdfasdf1'), false); -assert.equal(fs.existsSync('tmp/asdfasdf2'), false); - -shell.mv('asdfasdf1', 'asdfasdf2', 'tmp/file1'); // too many sources (dest is file) -assert.ok(shell.error()); - -shell.mv('tmp/file1', 'tmp/file2'); // dest already exists -assert.ok(shell.error()); - -shell.mv('tmp/file1', 'tmp/file2', 'tmp/a_file'); // too many sources (exist, but dest is file) -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/a_file'), false); - -shell.mv('tmp/file*', 'tmp/file1'); // can't use wildcard when dest is file -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); -assert.equal(fs.existsSync('tmp/file1.js'), true); -assert.equal(fs.existsSync('tmp/file2.js'), true); - -// -// Valids -// - -shell.cd('tmp'); - -// handles self OK -shell.mkdir('tmp2'); -shell.mv('*', 'tmp2'); // has to handle self (tmp2 --> tmp2) without throwing error -assert.ok(shell.error()); // there's an error, but not fatal -assert.equal(fs.existsSync('tmp2/file1'), true); // moved OK -shell.mv('tmp2/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); // moved OK - -shell.mv('file1', 'file3'); // one source -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file3'), true); -shell.mv('file3', 'file1'); // revert -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), true); - -// two sources -shell.rm('-rf', 't'); -shell.mkdir('-p', 't'); -shell.mv('file1', 'file2', 't'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), false); -assert.equal(fs.existsSync('t/file1'), true); -assert.equal(fs.existsSync('t/file2'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); -assert.equal(fs.existsSync('file2'), true); - -// two sources, array style -shell.rm('-rf', 't'); -shell.mkdir('-p', 't'); -shell.mv(['file1', 'file2'], 't'); // two sources -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), false); -assert.equal(fs.existsSync('t/file1'), true); -assert.equal(fs.existsSync('t/file2'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); -assert.equal(fs.existsSync('file2'), true); - -shell.mv('file*.js', 't'); // wildcard -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1.js'), false); -assert.equal(fs.existsSync('file2.js'), false); -assert.equal(fs.existsSync('t/file1.js'), true); -assert.equal(fs.existsSync('t/file2.js'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1.js'), true); -assert.equal(fs.existsSync('file2.js'), true); - -shell.mv('-f', 'file1', 'file2'); // dest exists, but -f given -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), true); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/popd.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/popd.js b/wp8/node_modules/shelljs/test/popd.js deleted file mode 100644 index fd79533..0000000 --- a/wp8/node_modules/shelljs/test/popd.js +++ /dev/null @@ -1,118 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(), trail; - -function reset() { - shell.dirs('-c'); - shell.cd(root); -} - -// Valid -shell.pushd('resources/pushd'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -shell.pushd('resources/pushd'); -shell.pushd('a'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -shell.pushd('b'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -shell.pushd('b'); -shell.pushd('c'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 1); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -// Valid by index -shell.pushd('resources/pushd'); -trail = shell.popd('+0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -shell.pushd('resources/pushd'); -trail = shell.popd('+1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-n'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -// Invalid -trail = shell.popd(); -assert.ok(shell.error('popd: directory stack empty\n')); - -// Test that the root dir is not stored -shell.cd('resources/pushd'); -shell.pushd('b'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(trail[0], path.resolve(root, 'resources/pushd')); -assert.equal(process.cwd(), trail[0]); -shell.popd(); -assert.ok(shell.error(), null); - -shell.cd(root); - -shell.exit(123); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/pushd.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/pushd.js b/wp8/node_modules/shelljs/test/pushd.js deleted file mode 100644 index 32089dc..0000000 --- a/wp8/node_modules/shelljs/test/pushd.js +++ /dev/null @@ -1,228 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(), trail; - -function reset() { - shell.dirs('-c'); - shell.cd(root); -} - -// Push valid directories -trail = shell.pushd('resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('a'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('../b'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('c'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push stuff around with positive indices -trail = shell.pushd('+0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('+1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c') -]); - -trail = shell.pushd('+2'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a') -]); - -trail = shell.pushd('+3'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c') -]); - -trail = shell.pushd('+4'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push stuff around with negative indices -trail = shell.pushd('-0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd') -]); - -trail = shell.pushd('-1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b') -]); - -trail = shell.pushd('-2'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd') -]); - -trail = shell.pushd('-3'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('-4'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push without changing directory or resolving paths -reset(); trail = shell.pushd('-n', 'resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - 'resources/pushd' -]); - -trail = shell.pushd('-n', 'resources/pushd/a'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - 'resources/pushd/a', - 'resources/pushd' -]); - -// Push invalid directory -shell.pushd('does/not/exist'); -assert.equal(shell.error(), 'pushd: no such file or directory: ' + path.resolve('.', 'does/not/exist') + '\n'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments should swap top two directories when stack length is 2 -reset(); trail = shell.pushd('resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(trail.length, 2); -assert.equal(path.relative(root, trail[0]), 'resources/pushd'); -assert.equal(trail[1], root); -assert.equal(process.cwd(), trail[0]); -trail = shell.pushd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 2); -assert.equal(trail[0], root); -assert.equal(path.relative(root, trail[1]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments should swap top two directories when stack length is > 2 -trail = shell.pushd('resources/pushd/a'); -assert.equal(shell.error(), null); -assert.equal(trail.length, 3); -assert.equal(path.relative(root, trail[0]), 'resources/pushd/a'); -assert.equal(trail[1], root); -assert.equal(path.relative(root, trail[2]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -trail = shell.pushd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 3); -assert.equal(trail[0], root); -assert.equal(path.relative(root, trail[1]), 'resources/pushd/a'); -assert.equal(path.relative(root, trail[2]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments invalid when stack is empty -reset(); shell.pushd(); -assert.equal(shell.error(), 'pushd: no other directory\n'); - -shell.exit(123); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/pwd.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/pwd.js b/wp8/node_modules/shelljs/test/pwd.js deleted file mode 100644 index d1f563f..0000000 --- a/wp8/node_modules/shelljs/test/pwd.js +++ /dev/null @@ -1,28 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'); - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -var _pwd = shell.pwd(); -assert.equal(shell.error(), null); -assert.equal(_pwd, path.resolve('.')); - -shell.cd('tmp'); -var _pwd = shell.pwd(); -assert.equal(shell.error(), null); -assert.equal(path.basename(_pwd), 'tmp'); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/a.txt ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/a.txt b/wp8/node_modules/shelljs/test/resources/a.txt deleted file mode 100644 index 356ce49..0000000 --- a/wp8/node_modules/shelljs/test/resources/a.txt +++ /dev/null @@ -1,11 +0,0 @@ -This is line one -This is line two - -This is line four -. -. -More content here -. -. - -This is line eleven http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore b/wp8/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore deleted file mode 100644 index e69de29..0000000 http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore b/wp8/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore deleted file mode 100644 index e69de29..0000000 http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore b/wp8/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore deleted file mode 100644 index e69de29..0000000 http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/chmod/file1 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/chmod/file1 b/wp8/node_modules/shelljs/test/resources/chmod/file1 deleted file mode 100644 index db3f9ca..0000000 --- a/wp8/node_modules/shelljs/test/resources/chmod/file1 +++ /dev/null @@ -1,2 +0,0 @@ -this is test file 1 -default state should be 0644 (rw-r--r--) http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/cp/a ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/cp/a b/wp8/node_modules/shelljs/test/resources/cp/a deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/cp/a +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/cp/b ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/cp/b b/wp8/node_modules/shelljs/test/resources/cp/b deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/cp/b +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/cp/dir_a/z ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/cp/dir_a/z b/wp8/node_modules/shelljs/test/resources/cp/dir_a/z deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/cp/dir_a/z +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z b/wp8/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/external/node_script.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/external/node_script.js b/wp8/node_modules/shelljs/test/resources/external/node_script.js deleted file mode 100644 index 3b2d24a..0000000 --- a/wp8/node_modules/shelljs/test/resources/external/node_script.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('node_script_1234'); - http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/file1 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/file1 b/wp8/node_modules/shelljs/test/resources/file1 deleted file mode 100644 index f079749..0000000 --- a/wp8/node_modules/shelljs/test/resources/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/file1.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/file1.js b/wp8/node_modules/shelljs/test/resources/file1.js deleted file mode 100644 index 9daeafb..0000000 --- a/wp8/node_modules/shelljs/test/resources/file1.js +++ /dev/null @@ -1 +0,0 @@ -test http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/file1.txt ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/file1.txt b/wp8/node_modules/shelljs/test/resources/file1.txt deleted file mode 100644 index a5bce3f..0000000 --- a/wp8/node_modules/shelljs/test/resources/file1.txt +++ /dev/null @@ -1 +0,0 @@ -test1 http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/file2 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/file2 b/wp8/node_modules/shelljs/test/resources/file2 deleted file mode 100644 index d606037..0000000 --- a/wp8/node_modules/shelljs/test/resources/file2 +++ /dev/null @@ -1 +0,0 @@ -test2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/file2.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/file2.js b/wp8/node_modules/shelljs/test/resources/file2.js deleted file mode 100644 index 9daeafb..0000000 --- a/wp8/node_modules/shelljs/test/resources/file2.js +++ /dev/null @@ -1 +0,0 @@ -test http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/file2.txt ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/file2.txt b/wp8/node_modules/shelljs/test/resources/file2.txt deleted file mode 100644 index 180cf83..0000000 --- a/wp8/node_modules/shelljs/test/resources/file2.txt +++ /dev/null @@ -1 +0,0 @@ -test2 http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/find/.hidden ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/find/.hidden b/wp8/node_modules/shelljs/test/resources/find/.hidden deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/find/.hidden +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/find/a ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/find/a b/wp8/node_modules/shelljs/test/resources/find/a deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/find/a +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/find/b ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/find/b b/wp8/node_modules/shelljs/test/resources/find/b deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/find/b +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/find/dir1/a_dir1 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/find/dir1/a_dir1 b/wp8/node_modules/shelljs/test/resources/find/dir1/a_dir1 deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/find/dir1/a_dir1 +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 b/wp8/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/find/dir2/a_dir1 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/find/dir2/a_dir1 b/wp8/node_modules/shelljs/test/resources/find/dir2/a_dir1 deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/find/dir2/a_dir1 +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/issue44/main.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/issue44/main.js b/wp8/node_modules/shelljs/test/resources/issue44/main.js deleted file mode 100644 index d800886..0000000 --- a/wp8/node_modules/shelljs/test/resources/issue44/main.js +++ /dev/null @@ -1 +0,0 @@ -123 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/.hidden_dir/nada ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/.hidden_dir/nada b/wp8/node_modules/shelljs/test/resources/ls/.hidden_dir/nada deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/.hidden_dir/nada +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/.hidden_file ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/.hidden_file b/wp8/node_modules/shelljs/test/resources/ls/.hidden_file deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/.hidden_file +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada b/wp8/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada deleted file mode 100644 index 5fedf57..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada +++ /dev/null @@ -1 +0,0 @@ -nada \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z b/wp8/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/a_dir/nada ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/a_dir/nada b/wp8/node_modules/shelljs/test/resources/ls/a_dir/nada deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/a_dir/nada +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/file1 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/file1 b/wp8/node_modules/shelljs/test/resources/ls/file1 deleted file mode 100644 index 9daeafb..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/file1 +++ /dev/null @@ -1 +0,0 @@ -test http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/file1.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/file1.js b/wp8/node_modules/shelljs/test/resources/ls/file1.js deleted file mode 100644 index 9daeafb..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/file1.js +++ /dev/null @@ -1 +0,0 @@ -test http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/file2 ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/file2 b/wp8/node_modules/shelljs/test/resources/ls/file2 deleted file mode 100644 index 9daeafb..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/file2 +++ /dev/null @@ -1 +0,0 @@ -test http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/file2.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/file2.js b/wp8/node_modules/shelljs/test/resources/ls/file2.js deleted file mode 100644 index 9daeafb..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/file2.js +++ /dev/null @@ -1 +0,0 @@ -test http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped b/wp8/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped deleted file mode 100644 index 8bd6648..0000000 --- a/wp8/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped +++ /dev/null @@ -1 +0,0 @@ -asdf http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/pushd/a/dummy ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/pushd/a/dummy b/wp8/node_modules/shelljs/test/resources/pushd/a/dummy deleted file mode 100644 index 72e12a9..0000000 --- a/wp8/node_modules/shelljs/test/resources/pushd/a/dummy +++ /dev/null @@ -1 +0,0 @@ -meh \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/resources/pushd/b/c/dummy ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/resources/pushd/b/c/dummy b/wp8/node_modules/shelljs/test/resources/pushd/b/c/dummy deleted file mode 100644 index 72e12a9..0000000 --- a/wp8/node_modules/shelljs/test/resources/pushd/b/c/dummy +++ /dev/null @@ -1 +0,0 @@ -meh \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/rm.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/rm.js b/wp8/node_modules/shelljs/test/rm.js deleted file mode 100644 index 61182a1..0000000 --- a/wp8/node_modules/shelljs/test/rm.js +++ /dev/null @@ -1,183 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.rm(); -assert.ok(shell.error()); - -shell.rm('asdfasdf'); // file does not exist -assert.ok(shell.error()); - -shell.rm('-f'); // no file -assert.ok(shell.error()); - -shell.rm('-@', 'resources/file1'); // invalid option -assert.ok(shell.error()); -assert.equal(fs.existsSync('resources/file1'), true); - -// -// Valids -// - -// file does not exist, but -f specified -shell.rm('-f', 'asdfasdf'); -assert.equal(shell.error(), null); - -// simple rm -shell.cp('-f', 'resources/file1', 'tmp/file1'); -assert.equal(fs.existsSync('tmp/file1'), true); -shell.rm('tmp/file1'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), false); - -// recursive dir removal - small-caps '-r' -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-rf', 'tmp/a'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// recursive dir removal - capital '-R' -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', 'tmp/a'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// recursive dir removal - absolute path -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', path.resolve('./tmp/a')); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// wildcard -shell.cp('-f', 'resources/file*', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); -assert.equal(fs.existsSync('tmp/file1.js'), true); -assert.equal(fs.existsSync('tmp/file2.js'), true); -shell.rm('tmp/file*'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), false); -assert.equal(fs.existsSync('tmp/file2'), false); -assert.equal(fs.existsSync('tmp/file1.js'), false); -assert.equal(fs.existsSync('tmp/file2.js'), false); - -// recursive dir removal -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', 'tmp/*'); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 1); -assert.equal(contents[0], '.hidden'); // shouldn't remove hiddden if no .* given - -// recursive dir removal -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', 'tmp/*', 'tmp/.*'); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 0); - -// recursive dir removal - array-syntax -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', ['tmp/*', 'tmp/.*']); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 0); - -// removal of a read-only file (unforced) -shell.mkdir('-p', 'tmp/readonly'); -'asdf'.to('tmp/readonly/file1'); -fs.chmodSync('tmp/readonly/file1', '0444'); // -r--r--r-- -shell.rm('tmp/readonly/file1'); -assert.equal(fs.existsSync('tmp/readonly/file1'), true); // bash's rm always asks before removing read-only files - // here we just assume "no" - -// removal of a read-only file (forced) -shell.mkdir('-p', 'tmp/readonly'); -'asdf'.to('tmp/readonly/file2'); -fs.chmodSync('tmp/readonly/file2', '0444'); // -r--r--r-- -shell.rm('-f', 'tmp/readonly/file2'); -assert.equal(fs.existsSync('tmp/readonly/file2'), false); - -// removal of a tree containing read-only files (unforced) -shell.mkdir('-p', 'tmp/tree2'); -'asdf'.to('tmp/tree2/file1'); -'asdf'.to('tmp/tree2/file2'); -fs.chmodSync('tmp/tree2/file1', '0444'); // -r--r--r-- -shell.rm('-r', 'tmp/tree2'); -assert.equal(fs.existsSync('tmp/tree2/file1'), true); -assert.equal(fs.existsSync('tmp/tree2/file2'), false); - -// removal of a tree containing read-only files (forced) -shell.mkdir('-p', 'tmp/tree'); -'asdf'.to('tmp/tree/file1'); -'asdf'.to('tmp/tree/file2'); -fs.chmodSync('tmp/tree/file1', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree'); -assert.equal(fs.existsSync('tmp/tree'), false); - -// removal of a sub-tree containing read-only and hidden files - rm('dir/*') -shell.mkdir('-p', 'tmp/tree3'); -shell.mkdir('-p', 'tmp/tree3/subtree'); -shell.mkdir('-p', 'tmp/tree3/.hidden'); -'asdf'.to('tmp/tree3/subtree/file'); -'asdf'.to('tmp/tree3/.hidden/file'); -'asdf'.to('tmp/tree3/file'); -fs.chmodSync('tmp/tree3/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree3/subtree/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree3/.hidden/file', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree3/*', 'tmp/tree3/.*'); // erase dir contents -assert.equal(shell.ls('tmp/tree3').length, 0); - -// removal of a sub-tree containing read-only and hidden files - rm('dir') -shell.mkdir('-p', 'tmp/tree4'); -shell.mkdir('-p', 'tmp/tree4/subtree'); -shell.mkdir('-p', 'tmp/tree4/.hidden'); -'asdf'.to('tmp/tree4/subtree/file'); -'asdf'.to('tmp/tree4/.hidden/file'); -'asdf'.to('tmp/tree4/file'); -fs.chmodSync('tmp/tree4/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree4/subtree/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree4/.hidden/file', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree4'); // erase dir contents -assert.equal(fs.existsSync('tmp/tree4'), false); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/sed.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/sed.js b/wp8/node_modules/shelljs/test/sed.js deleted file mode 100644 index d3d66b1..0000000 --- a/wp8/node_modules/shelljs/test/sed.js +++ /dev/null @@ -1,58 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.sed(); -assert.ok(shell.error()); - -shell.sed(/asdf/g); // too few args -assert.ok(shell.error()); - -shell.sed(/asdf/g, 'nada'); // too few args -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.sed(/asdf/g, 'nada', '/asdfasdf'); // no such file -assert.ok(shell.error()); - -// -// Valids -// - -shell.cp('-f', 'resources/file1', 'tmp/file1'); -var result = shell.sed('test1', 'hello', 'tmp/file1'); // search string -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); - -var result = shell.sed(/test1/, 'hello', 'tmp/file1'); // search regex -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); - -var result = shell.sed(/test1/, 1234, 'tmp/file1'); // numeric replacement -assert.equal(shell.error(), null); -assert.equal(result, '1234'); - -var result = shell.sed('-i', /test1/, 'hello', 'tmp/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); -assert.equal(shell.cat('tmp/file1'), 'hello'); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/tempdir.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/tempdir.js b/wp8/node_modules/shelljs/test/tempdir.js deleted file mode 100644 index 704ca56..0000000 --- a/wp8/node_modules/shelljs/test/tempdir.js +++ /dev/null @@ -1,27 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -var tmp = shell.tempdir(); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync(tmp), true); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/test.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/test.js b/wp8/node_modules/shelljs/test/test.js deleted file mode 100644 index a824edb..0000000 --- a/wp8/node_modules/shelljs/test/test.js +++ /dev/null @@ -1,91 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -var result = shell.test(); // no expression given -assert.ok(shell.error()); - -var result = shell.test('asdf'); // bad expression -assert.ok(shell.error()); - -var result = shell.test('f', 'resources/file1'); // bad expression -assert.ok(shell.error()); - -var result = shell.test('-f'); // no file -assert.ok(shell.error()); - -// -// Valids -// - -//exists -var result = shell.test('-e', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-e', 'resources/404'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//directory -var result = shell.test('-d', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-f', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-L', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//file -var result = shell.test('-d', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-f', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//link -var result = shell.test('-d', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-f', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/badlink'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/404'); -assert.equal(shell.error(), null); -assert.equal(result, false);//false - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/to.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/to.js b/wp8/node_modules/shelljs/test/to.js deleted file mode 100644 index 2e1253d..0000000 --- a/wp8/node_modules/shelljs/test/to.js +++ /dev/null @@ -1,39 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -'hello world'.to(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -'hello world'.to('/asdfasdf/file'); -assert.ok(shell.error()); - -// -// Valids -// - -'hello world'.to('tmp/to1'); -var result = shell.cat('tmp/to1'); -assert.equal(shell.error(), null); -assert.equal(result, 'hello world'); - -shell.exit(123); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/98448f5f/wp8/node_modules/shelljs/test/which.js ---------------------------------------------------------------------- diff --git a/wp8/node_modules/shelljs/test/which.js b/wp8/node_modules/shelljs/test/which.js deleted file mode 100644 index ac9a04d..0000000 --- a/wp8/node_modules/shelljs/test/which.js +++ /dev/null @@ -1,38 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.which(); -assert.ok(shell.error()); - -var result = shell.which('asdfasdfasdfasdfasdf'); // what are the odds... -assert.equal(shell.error(), null); -assert.equal(result, null); - -// -// Valids -// - -var result = shell.which('node'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync(result), true); - -shell.exit(123);