Skip to content

Commit fa82edd

Browse files
authored
Merge pull request #21 from ncphillips/16-catch-and-log-errors
16 catch and log errors
2 parents ed1183d + d3f36c4 commit fa82edd

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

packages/create-typescript-package/createTypescriptPackage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const program = new commander.Command(packageJson.name)
9797
)
9898
console.log(
9999
` ${chalk.cyan(
100-
"https://github.com/facebookincubator/create-typescript-package/issues/new"
100+
"https://github.com/ncphillips/create-typescript-package/issues/new"
101101
)}`
102102
)
103103
console.log()

packages/type-scripts/scripts/build.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /usr/bin/env node
2+
const chalk = require("chalk")
23
const path = require("path")
34
const rollupTypescript = require("rollup-plugin-typescript2")
45
const rollup = require("rollup")
@@ -48,8 +49,20 @@ async function build() {
4849
await bundle.write(outputOptions)
4950
}
5051

51-
try {
52-
build()
53-
} catch (e) {
54-
console.error("Failed to build Typescript project", e)
55-
}
52+
build().catch(e => {
53+
console.log(chalk.red("Build Failed"))
54+
console.log()
55+
console.log(
56+
chalk.red(
57+
"If you cannot figure out what's causing this failure please create a new issue in Github:"
58+
)
59+
)
60+
console.log()
61+
console.log(
62+
`\t${chalk.cyan(
63+
"https://github.com/ncphillips/create-typescript-package/issues/new"
64+
)}`
65+
)
66+
console.log()
67+
console.error(e)
68+
})

0 commit comments

Comments
 (0)