Skip to content

Commit

Permalink
refactor: remove try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Feb 16, 2023
1 parent aaec86d commit 847d7f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
29 changes: 11 additions & 18 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ module.exports = () => {

await importCwd(bin).build(env)

try {
updateNotifier({
pkg: importCwd('./node_modules/@maizzle/framework/package.json'),
shouldNotifyInNpmScript: true,
}).notify()
} catch (error) {
throw error
}
updateNotifier({
pkg: importCwd('./node_modules/@maizzle/framework/package.json'),
shouldNotifyInNpmScript: true,
}).notify()
})

program
Expand All @@ -66,17 +62,13 @@ module.exports = () => {
.action((env, options) => {
const bin = options.bin || './node_modules/@maizzle/framework/src'

try {
importCwd(bin).serve(env, {
build: {
console: {
clear: !options.noclear,
},
importCwd(bin).serve(env, {
build: {
console: {
clear: !options.noclear,
},
})
} catch (error) {
throw error
}
},
})
})

program
Expand All @@ -86,6 +78,7 @@ module.exports = () => {
.option('-v, --version', 'output current framework and CLI versions')
.on('option:version', () => {
const pkg = require('../package.json')

try {
const maizzle = importCwd('./node_modules/@maizzle/framework/package.json')
console.log(`Framework v${maizzle.version}\nCLI v${pkg.version}`)
Expand Down
1 change: 0 additions & 1 deletion xo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
rules: {
semi: 0,
camelcase: 0,
'no-useless-catch': 0,
'arrow-body-style': 0,
'unicorn/prefer-module': 0,
'unicorn/string-content': 0,
Expand Down

0 comments on commit 847d7f3

Please sign in to comment.