Skip to content

Instantly share code, notes, and snippets.

@muojp

muojp/Program.cs

Created Oct 20, 2015
Embed
What would you like to do?
Azure WebJobsからnode_modulesへインストールしたコマンドを呼び出す
[10/20/2015 12:43:29 > 123c4b: SYS INFO] Status changed to Initializing
[10/20/2015 12:43:29 > 123c4b: SYS INFO] Job directory change detected: Job file 'TestJob.exe' timestamp differs between source and working directories.
[10/20/2015 12:43:33 > 123c4b: SYS INFO] Run script 'TestJob.exe' with script host - 'WindowsScriptHost'
[10/20/2015 12:43:33 > 123c4b: SYS INFO] Status changed to Running
[10/20/2015 12:43:33 > 123c4b: INFO] testing node.js based command
[10/20/2015 12:43:33 > 123c4b: INFO] {
[10/20/2015 12:43:33 > 123c4b: INFO] - homepage: "https://github.com/andreyvit/json-diff"
[10/20/2015 12:43:33 > 123c4b: INFO] - bin: {
[10/20/2015 12:43:33 > 123c4b: INFO] - json-diff: "bin/json-diff.js"
[10/20/2015 12:43:33 > 123c4b: INFO] - }
[10/20/2015 12:43:33 > 123c4b: INFO] - readme: "JSON structural diff\n====================\n\nDoes exactly what you think it does:\n\n![Screenshot](https://github.com/andreyvit/json-diff/raw/master/doc/screenshot.png)\n\n\nInstallation\n------------\n\n npm install json-diff\n\n\nUsage\n-----\n\nSimple:\n\n json-diff a.json b.json\n\nDetailed:\n\n % json-diff --help\n Usage: json-diff [-vjC] first.json second.json\n\n Arguments:\n first.json Old file\n second.json New file\n\n General options:\n -v, --verbose Output progress info\n -C, --[no-]color Colored output\n -j, --raw-json Display raw JSON encoding of the diff\n -h, --help Display this usage information\n\n\nFeatures\n--------\n\n* colorized, diff-like output\n* fuzzy matching of modified array elements (when array elements are object hierarchies)\n* reasonable test coverage (far from 100%, though)\n\n\nTests\n-----\n\nRun:\n\n npm test\n\nTest coverage report:\n\n npm run-script cov\n\nOutput:\n\n colorize\n ✓ should return ' <value>' for a scalar value\n ✓ should return '-<old value>', '+<new value>' for a scalar diff\n ✓ should return '-<removed key>: <removed value>' for an object diff with a removed key\n ✓ should return '+<added key>: <added value>' for an object diff with an added key\n ✓ should return '+<added key>: <added stringified value>' for an object diff with an added key and a non-scalar value\n ✓ should return ' <modified key>: <colorized diff>' for an object diff with a modified key\n ✓ should return '+<inserted item>' for an array diff\n ✓ should return '-<deleted item>' for an array diff\n\n diff\n with simple scalar values\n ✓ should return undefined for two identical numbers\n ✓ should return undefined for two identical strings\n ✓ should return { __old: <old value>, __new: <new value> } object for two different numbers\n with objects\n ✓ should return undefined for two objects with identical contents\n ✓ should return undefined for two object hierarchies with identical contents\n ✓ should return { <key>__deleted: <old value> } when the second object is missing a key\n ✓ should return { <key>__added: <new value> } when the first object is missing a key\n ✓ should return { <key>: { __old: <old value>, __new: <new value> } } for two objects with diffent scalar values for a key\n ✓ should return { <key>: <diff> } with a recursive diff for two objects with diffent values for a key\n with arrays of scalars\n ✓ should return undefined for two arrays with identical contents\n ✓ should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value\n ✓ should return [..., ['+', <added item>], ...] for two arrays when the second one has an extra value\n ✓ should return [..., ['+', <added item>]] for two arrays when the second one has an extra value at the end (edge case test)\n with arrays of objects\n ✓ should return undefined for two arrays with identical contents\n ✓ should return [..., ['-', <removed item>], ...] for two arrays when the second array is missing a value\n ✓ should return [..., ['+', <added item>], ...] for two arrays when the second array has an extra value\n ✓ should return [..., ['~', <diff>], ...] for two arrays when an item has been modified (note: involves a crazy heuristic)\n\n ✔ 25 tests complete (12ms)\n\n\nLicense\n-------\n\n© Andrey Tarantsov. Distributed under the MIT license.\n"
[10/20/2015 12:43:33 > 123c4b: INFO] + keywords: [
[10/20/2015 12:43:33 > 123c4b: INFO] + "ansi"
[10/20/2015 12:43:33 > 123c4b: INFO] + "color"
[10/20/2015 12:43:33 > 123c4b: INFO] + "console"
[10/20/2015 12:43:33 > 123c4b: INFO] + "terminal"
[10/20/2015 12:43:33 > 123c4b: INFO] + "cli"
[10/20/2015 12:43:33 > 123c4b: INFO] + "shell"
[10/20/2015 12:43:33 > 123c4b: INFO] + "log"
[10/20/2015 12:43:33 > 123c4b: INFO] + "logging"
[10/20/2015 12:43:33 > 123c4b: INFO] + "xterm"
[10/20/2015 12:43:33 > 123c4b: INFO] + ]
[10/20/2015 12:43:33 > 123c4b: INFO] + bugs: {
[10/20/2015 12:43:33 > 123c4b: INFO] + email: "medikoo+cli-color@medikoo.com"
[10/20/2015 12:43:33 > 123c4b: INFO] + url: "https://github.com/medikoo/cli-color/issues"
[10/20/2015 12:43:33 > 123c4b: INFO] + }
[10/20/2015 12:43:33 > 123c4b: INFO] + _engineSupported: true
[10/20/2015 12:43:33 > 123c4b: INFO] + _nodeVersion: "v0.6.19"
[10/20/2015 12:43:33 > 123c4b: INFO] + _defaultsLoaded: true
[10/20/2015 12:43:33 > 123c4b: INFO] author: {
[10/20/2015 12:43:33 > 123c4b: INFO] + url: "http://www.medikoo.com/"
[10/20/2015 12:43:33 > 123c4b: INFO] - name: "Andrey Tarantsov"
[10/20/2015 12:43:33 > 123c4b: INFO] + name: "Mariusz Nowak"
[10/20/2015 12:43:33 > 123c4b: INFO] - email: "andreyvit@me.com"
[10/20/2015 12:43:33 > 123c4b: INFO] + email: "medikoo+cli-color@medikoo.com"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] - name: "json-diff"
[10/20/2015 12:43:33 > 123c4b: INFO] + name: "cli-color"
[10/20/2015 12:43:33 > 123c4b: INFO] - description: "JSON diff"
[10/20/2015 12:43:33 > 123c4b: INFO] + description: "Colors, formatting and other tools for the console"
[10/20/2015 12:43:33 > 123c4b: INFO] - version: "0.3.1"
[10/20/2015 12:43:33 > 123c4b: INFO] + version: "0.1.7"
[10/20/2015 12:43:33 > 123c4b: INFO] repository: {
[10/20/2015 12:43:33 > 123c4b: INFO] + type: "git"
[10/20/2015 12:43:33 > 123c4b: INFO] - url: "git@github.com:andreyvit/json-diff.git"
[10/20/2015 12:43:33 > 123c4b: INFO] + url: "git://github.com/medikoo/cli-color.git"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] - main: "lib/index.js"
[10/20/2015 12:43:33 > 123c4b: INFO] + main: "lib"
[10/20/2015 12:43:33 > 123c4b: INFO] scripts: {
[10/20/2015 12:43:33 > 123c4b: INFO] - cov: "rm -rf lib-cov; jscoverage lib lib-cov; env JSLIB=lib-cov mocha -R dot && env JSLIB=lib-cov mocha -R html-cov >coverage.html; open coverage.html"
[10/20/2015 12:43:33 > 123c4b: INFO] - test: "./node_modules/mocha/bin/mocha"
[10/20/2015 12:43:33 > 123c4b: INFO] + test: "node ./node_modules/tad/bin/tad lib"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] dependencies: {
[10/20/2015 12:43:33 > 123c4b: INFO] - dreamopt: "~0.6.0"
[10/20/2015 12:43:33 > 123c4b: INFO] - difflib: "~0.2.1"
[10/20/2015 12:43:33 > 123c4b: INFO] - cli-color: "~0.1.6"
[10/20/2015 12:43:33 > 123c4b: INFO] + es5-ext: "0.8.x"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] devDependencies: {
[10/20/2015 12:43:33 > 123c4b: INFO] - mocha: "~1.7.0"
[10/20/2015 12:43:33 > 123c4b: INFO] + clock: "0.1.x"
[10/20/2015 12:43:33 > 123c4b: INFO] + tad: "0.1.x"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] engines: {
[10/20/2015 12:43:33 > 123c4b: INFO] - node: "*"
[10/20/2015 12:43:33 > 123c4b: INFO] + node: ">=0.1.103"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] - _id: "json-diff@0.3.1"
[10/20/2015 12:43:33 > 123c4b: INFO] + _id: "cli-color@0.1.7"
[10/20/2015 12:43:33 > 123c4b: INFO] dist: {
[10/20/2015 12:43:33 > 123c4b: INFO] - shasum: "6dbc3ae2d25e075a7fd71bcd9874458666fb681b"
[10/20/2015 12:43:33 > 123c4b: INFO] + shasum: "adc3200fa471cc211b0da7f566b71e98b9d67347"
[10/20/2015 12:43:33 > 123c4b: INFO] - tarball: "http://registry.npmjs.org/json-diff/-/json-diff-0.3.1.tgz"
[10/20/2015 12:43:33 > 123c4b: INFO] + tarball: "http://registry.npmjs.org/cli-color/-/cli-color-0.1.7.tgz"
[10/20/2015 12:43:33 > 123c4b: INFO] }
[10/20/2015 12:43:33 > 123c4b: INFO] - _npmVersion: "1.1.62"
[10/20/2015 12:43:33 > 123c4b: INFO] + _npmVersion: "1.1.24"
[10/20/2015 12:43:33 > 123c4b: INFO] _npmUser: {
[10/20/2015 12:43:33 > 123c4b: INFO] - name: "andreyvit"
[10/20/2015 12:43:33 > 123c4b: INFO] + name: "medikoo"
[10/20/2015 12:43:34 > 123c4b: INFO] - email: "andrey@tarantsov.com"
[10/20/2015 12:43:34 > 123c4b: INFO] + email: "medikoo+npm@medikoo.com"
[10/20/2015 12:43:34 > 123c4b: INFO] }
[10/20/2015 12:43:34 > 123c4b: INFO] maintainers: [
[10/20/2015 12:43:34 > 123c4b: INFO] - {
[10/20/2015 12:43:34 > 123c4b: INFO] - name: "andreyvit"
[10/20/2015 12:43:34 > 123c4b: INFO] - email: "andreyvit@me.com"
[10/20/2015 12:43:34 > 123c4b: INFO] - }
[10/20/2015 12:43:34 > 123c4b: INFO] + {
[10/20/2015 12:43:34 > 123c4b: INFO] + name: "medikoo"
[10/20/2015 12:43:34 > 123c4b: INFO] + email: "medikoo+npm@medikoo.com"
[10/20/2015 12:43:34 > 123c4b: INFO] + }
[10/20/2015 12:43:34 > 123c4b: INFO] ]
[10/20/2015 12:43:34 > 123c4b: INFO] - _shasum: "6dbc3ae2d25e075a7fd71bcd9874458666fb681b"
[10/20/2015 12:43:34 > 123c4b: INFO] + _shasum: "adc3200fa471cc211b0da7f566b71e98b9d67347"
[10/20/2015 12:43:34 > 123c4b: INFO] - _from: "json-diff@"
[10/20/2015 12:43:34 > 123c4b: INFO] + _from: "cli-color@~0.1.6"
[10/20/2015 12:43:34 > 123c4b: INFO] - _resolved: "https://registry.npmjs.org/json-diff/-/json-diff-0.3.1.tgz"
[10/20/2015 12:43:34 > 123c4b: INFO] + _resolved: "https://registry.npmjs.org/cli-color/-/cli-color-0.1.7.tgz"
[10/20/2015 12:43:34 > 123c4b: INFO] }
[10/20/2015 12:43:34 > 123c4b: SYS INFO] Status changed to Success
using System;
using System.Diagnostics;
namespace TestJob
{
class Program
{
static void Main()
{
Console.WriteLine("testing node.js based command");
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = @"D:\home\node_modules\.bin\json-diff.cmd",
Arguments = @"""D:\home\node_modules\json-diff\package.json"" ""D:\home\node_modules\json-diff\node_modules\cli-color\package.json""",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
}
};
proc.Start();
while (!proc.StandardOutput.EndOfStream)
{
Console.WriteLine(proc.StandardOutput.ReadLine());
}
proc.WaitForExit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment