zarro 1.166.0 → 1.166.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +13 -10
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -192,11 +192,7 @@ async function transpileTypeScriptFiles(
192
192
  return;
193
193
  }
194
194
 
195
- try {
196
- require("typescript");
197
- } catch (e) {
198
- throw new Error(`TypeScript not installed, unable to transpile local tasks: \n- ${ toTranspile.join("\n -") }`);
199
- }
195
+ importTypeScript();
200
196
 
201
197
  try {
202
198
  const
@@ -254,6 +250,17 @@ async function transpileTasksUnder(folder) {
254
250
  );
255
251
  }
256
252
 
253
+ function importTypeScript() {
254
+ try {
255
+ require("typescript");
256
+ } catch (e) {
257
+ const message = `TypeScript not installed, unable to transpile local tasks: \n- ${ toTranspile.join("\n -") }`;
258
+ console.error(message);
259
+ process.exit(2);
260
+ }
261
+ }
262
+
263
+
257
264
  async function transpileTasksUnder_(folder) {
258
265
  const toTranspile = [];
259
266
  const fullPath = path.isAbsolute(folder)
@@ -274,11 +281,7 @@ async function transpileTasksUnder_(folder) {
274
281
  return;
275
282
  }
276
283
 
277
- try {
278
- require("typescript");
279
- } catch (e) {
280
- throw new Error(`TypeScript not installed, unable to transpile local tasks: \n- ${ toTranspile.join("\n -") }`);
281
- }
284
+ importTypeScript();
282
285
 
283
286
  try {
284
287
  const
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.166.0",
3
+ "version": "1.166.4",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "./index.js"