diff --git a/lib/commands/diff.js b/lib/commands/diff.js index 2a5104d..b80f799 100644 --- a/lib/commands/diff.js +++ b/lib/commands/diff.js @@ -6,6 +6,7 @@ 'use strict'; const chalk = require( 'chalk' ); +const shellescape = require('shell-escape'); module.exports = { skipCounter: true, @@ -41,7 +42,7 @@ module.exports = { */ execute( data ) { const execCommand = require( './exec' ); - const diffCommand = ( 'git diff --color ' + data.arguments.join( ' ' ) ).trim(); + const diffCommand = ( 'git diff --color ' + shellescape(data.arguments) ).trim(); return execCommand.execute( getExecData( diffCommand ) ) .then( execResponse => { diff --git a/package.json b/package.json index 6cad55f..e1130cb 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "minimatch": "^3.0.4", "minimist": "^1.2.0", "minimist-options": "^4.0.1", + "shell-escape": "^0.2.0", "shelljs": "^0.8.3", "upath": "^1.1.2" },