Skip to content

Commit

Permalink
add ng-alain grails command
Browse files Browse the repository at this point in the history
  • Loading branch information
hasegetc committed Mar 31, 2020
1 parent b8d00e9 commit 9a0bb54
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
23 changes: 23 additions & 0 deletions commands/ng-alain-curd.groovy
Original file line number Diff line number Diff line change
@@ -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"
}
24 changes: 24 additions & 0 deletions commands/ng-alain-edit.groovy
Original file line number Diff line number Diff line change
@@ -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"
}
24 changes: 24 additions & 0 deletions commands/ng-alain-list.groovy
Original file line number Diff line number Diff line change
@@ -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"
}
24 changes: 24 additions & 0 deletions commands/ng-alain-view.groovy
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 9a0bb54

Please sign in to comment.