zarro 1.159.0 → 1.161.0
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.
- package/gulp-tasks/generate-local-task.js +10 -9
- package/package.json +1 -1
- package/types.d.ts +1 -1
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
(function () {
|
|
3
3
|
const gulp = requireModule("gulp");
|
|
4
4
|
gulp.task("generate-local-task", async () => {
|
|
5
|
-
const path = require("path"), { ask } = requireModule("ask"), rawName = await ask("name of new task"), { writeTextFile, fileExists } = require("yafs"), taskName = rawName.trim().replace(/\s+/g, "-"), target = path.join("local-tasks", `${taskName}.ts`);
|
|
5
|
+
const log = requireModule("log"), path = require("path"), { ask } = requireModule("ask"), rawName = await ask("name of new task"), { writeTextFile, fileExists } = require("yafs"), taskName = rawName.trim().replace(/\s+/g, "-"), target = path.join("local-tasks", `${taskName}.ts`);
|
|
6
6
|
if (await fileExists(target)) {
|
|
7
7
|
throw new Error(`File already exists at '${target}' - remove it first or rename your task`);
|
|
8
8
|
}
|
|
9
9
|
await writeTextFile(target, template.replace("%TASK_NAME%", taskName));
|
|
10
|
+
log.info(`generated new task file at: ${target}`);
|
|
10
11
|
});
|
|
11
|
-
const template = `
|
|
12
|
-
/// <reference path="../node_modules/zarro/types.d.ts" />
|
|
13
|
-
const
|
|
14
|
-
gulp = requireModule<Gulp>("gulp");
|
|
15
|
-
|
|
16
|
-
gulp.task(\`%TASK_NAME%\`, async () => {
|
|
17
|
-
|
|
18
|
-
});
|
|
12
|
+
const template = `
|
|
13
|
+
/// <reference path="../node_modules/zarro/types.d.ts" />
|
|
14
|
+
const
|
|
15
|
+
gulp = requireModule<Gulp>("gulp");
|
|
16
|
+
|
|
17
|
+
gulp.task(\`%TASK_NAME%\`, async () => {
|
|
18
|
+
|
|
19
|
+
});
|
|
19
20
|
`.trim();
|
|
20
21
|
})();
|
package/package.json
CHANGED
package/types.d.ts
CHANGED