Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence output #4

Merged
merged 4 commits into from Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/create.spec.js
Expand Up @@ -39,7 +39,7 @@ function createAndBuild(projectname, projectid) {
// create the project
command = util.format('"%s" "%s/%s" "%s" "%s"', createScriptPath, tmpDir, projectname, projectid, projectname);
//shell.echo(command);
return_code = shell.exec(command).code;
return_code = shell.exec(command, { silent: true }).code;
expect(return_code).toBe(0);


Expand Down
24 changes: 10 additions & 14 deletions src/cordova/Api.js
Expand Up @@ -63,29 +63,25 @@ Api.createPlatform = function (destination, config, options, events) {
events.emit('log', '\tPath: ' + destination);
events.emit('log', '\tName: ' + projectName);

shell.mkdir(destination);
shell.mkdir('-p', destination);

// move a copy of our api to the new project
shell.cp('-r',apiSrcPath, destination);

// move our node_modules
janpio marked this conversation as resolved.
Show resolved Hide resolved
var srcModulePath = path.join(__dirname,'../../node_modules');
shell.cp('-r',srcModulePath,destination);

// I promise I will return
return Promise.resolve(new Api(PLATFORM_NAME,destination,events));

};


Api.updatePlatform = function (destination, options, events) {
// console.log("test-platform:Api:updatePlatform");
events.emit('log', "test-platform:Api:updatePlatform");
// todo?: create projectInstance and fulfill promise with it.
return Promise.resolve();
};

Api.prototype.getPlatformInfo = function () {
console.log("test-platform:Api:getPlatformInfo");
events.emit('log', "test-platform:Api:getPlatformInfo");
// return PlatformInfo object

return {
Expand All @@ -98,36 +94,36 @@ Api.prototype.getPlatformInfo = function () {
};

Api.prototype.prepare = function (cordovaProject) {
console.log("test-platform:Api:prepare");
events.emit('log', "test-platform:Api:prepare");
return Promise.resolve();
};

Api.prototype.addPlugin = function (plugin, installOptions) {
console.log("test-platform:Api:addPlugin");
events.emit('log', "test-platform:Api:addPlugin");
return Promise.resolve();
};

Api.prototype.removePlugin = function (plugin, uninstallOptions) {
console.log("test-platform:Api:removePlugin");
events.emit('log', "test-platform:Api:removePlugin");
return Promise.resolve();
};

Api.prototype.build = function (buildOptions) {
console.log("test-platform:Api:build");
events.emit('log', "test-platform:Api:build");
return Promise.resolve();
};

Api.prototype.run = function(runOptions) {
console.log("test-platform:Api:run");
events.emit('log', "test-platform:Api:run");
};

Api.prototype.clean = function(cleanOptions) {
console.log("test-platform:Api:clean");
events.emit('log', "test-platform:Api:clean");
return Promise.resolve();
};

Api.prototype.requirements = function() {
console.log("test-platform:Api:requirements");
events.emit('log', "test-platform:Api:requirements");
return true;
};

Expand Down