@naseej/blox 0.1.12 → 0.1.14
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/dist/run.js +13 -1
- package/package.json +1 -1
package/dist/run.js
CHANGED
|
@@ -31,7 +31,7 @@ var option = (flags, description) => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
// package.json
|
|
34
|
-
var version = "0.1.
|
|
34
|
+
var version = "0.1.13";
|
|
35
35
|
|
|
36
36
|
// src/commands/add/index.ts
|
|
37
37
|
var import_fs_extra6 = __toESM(require("fs-extra"));
|
|
@@ -77,6 +77,7 @@ var logWarningSection = (title, content) => {
|
|
|
77
77
|
|
|
78
78
|
// src/services/shell.ts
|
|
79
79
|
var $ = async (bin, options = [], { cwd, onStdout } = {}) => {
|
|
80
|
+
debug(`Command executed: ${bin} ${options.join(" ")} in ${cwd}`);
|
|
80
81
|
return new Promise(function(resolve, reject) {
|
|
81
82
|
const child = (0, import_node_child_process.spawn)(bin, options, { cwd, shell: true, stdio: ["pipe", "pipe", "pipe"] });
|
|
82
83
|
let error2 = "";
|
|
@@ -436,6 +437,15 @@ var textList = async (opts) => {
|
|
|
436
437
|
return value.split(",");
|
|
437
438
|
};
|
|
438
439
|
|
|
440
|
+
// src/commands/init/utils/index.ts
|
|
441
|
+
function runInitScript(cwd) {
|
|
442
|
+
debug(`Run init script in: ${cwd}`);
|
|
443
|
+
const info = getTemplateInfo(cwd);
|
|
444
|
+
if (info.init) {
|
|
445
|
+
return $(info.init, [], { cwd });
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
439
449
|
// src/commands/add/index.ts
|
|
440
450
|
var addBlock = async (block, blocks) => {
|
|
441
451
|
const blockPath = `blocks/${block}`;
|
|
@@ -448,6 +458,7 @@ var addBlock = async (block, blocks) => {
|
|
|
448
458
|
await git.unInit(blockPath);
|
|
449
459
|
await replacePlaceholders(blockPath, {});
|
|
450
460
|
saveBasedOnInfo({ commit }, blockPath);
|
|
461
|
+
await runInitScript(blockPath);
|
|
451
462
|
task.stop(`Block ${block} added`);
|
|
452
463
|
} else {
|
|
453
464
|
import_prompts2.log.warn(`${block} already exists, may need to be updated`);
|
|
@@ -539,6 +550,7 @@ var init2 = command("init").description("Init new app").alias("i").option("-n, -
|
|
|
539
550
|
await replacePlaceholders(name, { app: { name } });
|
|
540
551
|
saveBasedOnInfo({ commit }, name);
|
|
541
552
|
await git.init(name);
|
|
553
|
+
await runInitScript(name);
|
|
542
554
|
task.stop(`App initialized in ${name}`);
|
|
543
555
|
} catch (e) {
|
|
544
556
|
error(e);
|