Skip to content

Commit

Permalink
fix(generate): files now generated in the appropriate directory
Browse files Browse the repository at this point in the history
closes #31
  • Loading branch information
robophil committed Oct 20, 2017
1 parent e90e07c commit 2b45f75
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/cmd/types/publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = (names, options) => {
copy(names, type, regex).then(() => {
console.log('\n')
names.forEach(name => {
console.info(`\tNew ${type} has been created as src/app/${name}.${type}.js`)
console.info(`\tNew ${type} has been created as src/app/${type}/${name}.${type}.js`)
})
console.log('\n')
}).catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion bin/cmd/types/requester.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = (names, options) => {
copy(names, type, regex).then(() => {
console.log('\n')
names.forEach(name => {
console.info(`\tNew ${type} has been created as src/app/${name}.${type}.js`)
console.info(`\tNew ${type} has been created as src/app/${type}/${name}.${type}.js`)
})
console.log('\n')
}).catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion bin/cmd/types/responder.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = (names, options) => {
copy(names, type, regex).then(() => {
console.log('\n')
names.forEach(name => {
console.info(`\tNew ${type} has been created as src/app/${name}.${type}.js`)
console.info(`\tNew ${type} has been created as src/app/${type}/${name}.${type}.js`)
})
console.log('\n')
}).catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion bin/cmd/types/subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = (names, options) => {
copy(names, type, regex).then(() => {
console.log('\n')
names.forEach(name => {
console.info(`\tNew ${type} has been created as src/app/${name}.${type}.js`)
console.info(`\tNew ${type} has been created as src/app/${type}/${name}.${type}.js`)
})
console.log('\n')
}).catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion helper/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const cwd = process.cwd()

module.exports = (names, type, regex) => {
const src = path.resolve(__dirname, '..', `files/${type}.js`)
const dest = (type === 'model') ? `${cwd}/src/models/` : `${cwd}/src/app/`
const dest = (type === 'model') ? `${cwd}/src/models/` : `${cwd}/src/app/${type}/`

return fs.ensureDir(dest).then(() => {
const copyAction = []
Expand Down

0 comments on commit 2b45f75

Please sign in to comment.