Skip to content

Commit

Permalink
refactor: wrap execSync with encoding: utf-8 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui authored and Ace Nassri committed Nov 17, 2022
1 parent d7b9d30 commit d0f5c20
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

'use strict';

const {execSync} = require('child_process');
const cp = require('child_process');
const {assert} = require('chai');
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-annotation-to-storage.js`;
const project = process.env.GLCOUD_PROJECT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

'use strict';

const {execSync} = require('child_process');
const cp = require('child_process');
const {assert} = require('chai');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-labels.js`;
const file = 'resources/cat.mp4';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

'use strict';

const {execSync} = require('child_process');
const cp = require('child_process');
const {assert} = require('chai');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-object.js`;
const file = 'resources/cat.mp4';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

'use strict';

const {execSync} = require('child_process');
const cp = require('child_process');
const {assert} = require('chai');
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-safe-search.js`;
const file = 'resources/cat.mp4';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

'use strict';

const {execSync} = require('child_process');
const cp = require('child_process');
const {assert} = require('chai');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-shot-change.js`;
const file = 'resources/cat.mp4';

Expand Down
4 changes: 3 additions & 1 deletion video-intelligence/system-test/analyze.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
'use strict';

const {assert} = require('chai');
const {execSync} = require('child_process');
const cp = require('child_process');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = 'node analyze.js';
const url = 'gs://nodejs-docs-samples-video/quickstart.mp4';
Expand Down
4 changes: 3 additions & 1 deletion video-intelligence/system-test/analyze.v1p2beta1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
'use strict';

const {assert} = require('chai');
const {execSync} = require('child_process');
const cp = require('child_process');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = 'node analyze.v1p2beta1.js';
const shortUrl = 'gs://nodejs-docs-samples/video/googlework_short.mp4';
Expand Down
4 changes: 3 additions & 1 deletion video-intelligence/system-test/quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

const path = require('path');
const {assert} = require('chai');
const {execSync} = require('child_process');
const cp = require('child_process');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = 'node quickstart.js';
const cwd = path.join(__dirname, '..');
Expand Down

0 comments on commit d0f5c20

Please sign in to comment.