Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

How to execute a NodeJs script in azure-scm-console, having canvas-data-cli command #16

Open
MuhammadUmarFarooq786 opened this issue Dec 20, 2018 · 0 comments

Comments

@MuhammadUmarFarooq786
Copy link

Description

I can run the canvasDataCli sync command directly from console successfully as:

canvasDataCli sync -c ./config.js

Here is the code file, test.js

var Promise = require('promise');

require('canvas-data-cli');

var s='./config.js';
var command=canvasDataCli sync -c ${s};

function exec_command_promise(cmd) {
return new Promise(function (resolve, reject) {

var exec = require('child_process').exec;
var child_process = exec(cmd);

// event : stdout
child_process.stdout.on('data', data => {
    console.log(data);
});

// event : stderr
child_process.stderr.on('data', data => {
    console.log(data);
    reject(data);
});

// event : close
child_process.on('close', data => {
    console.log(data);
    resolve(data);
});

});
};

Additional Information

Node version: 10.14.1
Platform: Windows

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant