Navigation Menu

Skip to content

Commit

Permalink
Exit with error code by cs-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 6, 2012
1 parent 99d2f33 commit 1199141
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions bin/cs-configure-fields
Expand Up @@ -26,38 +26,38 @@ program

if (!program.domainName) {
console.log('You must specify the domain name.');
return false;
return process.exit(1);
}

var context = commandLine.getContext(program.databasePath);
var domain = new commandLine.Domain(program.domainName, context);
if (!domain.exists()) {
console.log('You must specify an existing domain name.');
return false;
return process.exit(1);
}

if (!program.name) {
console.log('You must specify the field name.');
return false;
return process.exit(1);
}

var field = domain.getIndexField(program.name);

if (program.delete) {
if (!field.exists()) {
console.log('You must specify an existing field.');
return false;
return process.exit(1);
}
field.deleteSync();
console.log('Updated 1 Index Field:');
} else {
if (!program.type) {
console.log('You must specify the field type.');
return false;
return process.exit(1);
}
if (field.exists()) {
console.log('You must specify not-existing field name.');
return false;
return process.exit(1);
}
field.type = program.type;
field.createSync();
Expand Down
4 changes: 2 additions & 2 deletions bin/cs-create-domain
Expand Up @@ -17,7 +17,7 @@ program

if (!program.domainName) {
console.log('You must specify the domain name.');
return false;
return process.exit(1);
}

console.log('Creating domain [' + program.domainName + ']');
Expand All @@ -26,7 +26,7 @@ var context = commandLine.getContext(program.databasePath);
var domain = new commandLine.Domain(program.domainName, context);
if (domain.exists()) {
console.log('The domain [' + program.domainName + '] already exists.');
return false;
return process.exit(1);
}

domain.createSync();
Expand Down

0 comments on commit 1199141

Please sign in to comment.