diff --git a/commands/ng-alain-curd.groovy b/commands/ng-alain-curd.groovy new file mode 100644 index 0000000..2c85721 --- /dev/null +++ b/commands/ng-alain-curd.groovy @@ -0,0 +1,23 @@ +description("TODO: command description") { + usage "grails ng-alain-curd" + + // TODO: populate arguments + argument name: 'arg1', description: "arg1 description", required: true + + // TODO: populate flags + flag name: 'flag1', description: "flag1 description" +} + +if (args) { + def modelName = args[0].toLowerCase() + + def createModuleCommand = "ng g ng-alain:module ${modelName}" + def execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() + + createModuleCommand = "ng g ng-alain:curd curd -m ${modelName}" + execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() +} else { + error "No argument specified" +} diff --git a/commands/ng-alain-edit.groovy b/commands/ng-alain-edit.groovy new file mode 100644 index 0000000..c5e2a8b --- /dev/null +++ b/commands/ng-alain-edit.groovy @@ -0,0 +1,24 @@ +description( "TODO: command description" ) { + usage "grails ng-alain-edit" + + // TODO: populate arguments + argument name:'arg1', description:"arg1 description", required:true + + // TODO: populate flags + flag name:'flag1', description:"flag1 description" +} + +if(args) { + def modelName = args[0] + + def createModuleCommand = "ng g ng-alain:module ${modelName}" + def execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() + + createModuleCommand = "ng g ng-alain:edit edit -m ${modelName} -t=curd" + execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() +} +else { + error "No argument specified" +} diff --git a/commands/ng-alain-list.groovy b/commands/ng-alain-list.groovy new file mode 100644 index 0000000..dec52e0 --- /dev/null +++ b/commands/ng-alain-list.groovy @@ -0,0 +1,24 @@ +description( "TODO: command description" ) { + usage "grails ng-alain-list" + + // TODO: populate arguments + argument name:'arg1', description:"arg1 description", required:true + + // TODO: populate flags + flag name:'flag1', description:"flag1 description" +} + +if(args) { + def modelName = args[0] + + def createModuleCommand = "ng g ng-alain:module ${modelName}" + def execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() + + createModuleCommand = "ng g ng-alain:list list -m ${modelName} -t=curd" + execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() +} +else { + error "No argument specified" +} diff --git a/commands/ng-alain-view.groovy b/commands/ng-alain-view.groovy new file mode 100644 index 0000000..6e4714b --- /dev/null +++ b/commands/ng-alain-view.groovy @@ -0,0 +1,24 @@ +description( "TODO: command description" ) { + usage "grails ng-alain-view" + + // TODO: populate arguments + argument name:'arg1', description:"arg1 description", required:true + + // TODO: populate flags + flag name:'flag1', description:"flag1 description" +} + +if(args) { + def modelName = args[0] + + def createModuleCommand = "ng g ng-alain:module ${modelName}" + def execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() + + createModuleCommand = "ng g ng-alain:view view -m ${modelName} -t=curd" + execute = createModuleCommand.execute(null, new File("../client")) + execute.waitFor() +} +else { + error "No argument specified" +}