Skip to content

Commit 95d2845

Browse files
committed
feat: exit(1) on error
1 parent fc19fcb commit 95d2845

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/source.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ const selfLocation = join(
1717
__dirname.endsWith("build/src") ? "../../" : "./"
1818
);
1919

20-
const tsNodeLocation = join(
21-
selfLocation,
22-
__dirname.endsWith("build/src")
23-
? "node_modules/.bin/"
24-
: "../node_modules/.bin/"
25-
);
20+
const tsNodeLocation = join(selfLocation, "../node_modules/.bin/");
2621

2722
async function materializeFunctionInFile(source: SourceFile, target: Target) {
2823
const localPath = relative(cwd(), source.getFilePath());
@@ -86,6 +81,10 @@ async function materializeFunctionInFile(source: SourceFile, target: Target) {
8681
source.organizeImports();
8782
await source.save();
8883
log(`${error ?? "completed"}`);
84+
85+
if (error) {
86+
process.exit(1);
87+
}
8988
}
9089

9190
export async function main(path = "**/*.ts") {

0 commit comments

Comments
 (0)