[fix] fetch
This commit is contained in:
parent
27336159db
commit
e859530652
|
@ -27,8 +27,10 @@ namespace _munin
|
||||||
command : string,
|
command : string,
|
||||||
{
|
{
|
||||||
"log_only": log_only = false,
|
"log_only": log_only = false,
|
||||||
|
"working_directory": working_directory = null,
|
||||||
} : {
|
} : {
|
||||||
log_only ?: boolean;
|
log_only ?: boolean;
|
||||||
|
working_directory ?: (null | string);
|
||||||
} = {
|
} = {
|
||||||
}
|
}
|
||||||
) : Promise<
|
) : Promise<
|
||||||
|
@ -64,6 +66,7 @@ namespace _munin
|
||||||
nm_child_process.exec(
|
nm_child_process.exec(
|
||||||
command,
|
command,
|
||||||
{
|
{
|
||||||
|
"cwd": ((working_directory === null) ? undefined : working_directory),
|
||||||
},
|
},
|
||||||
(error, stdout, stderr) => {
|
(error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -218,35 +221,34 @@ namespace _munin
|
||||||
for (const lib of data.libs) {
|
for (const lib of data.libs) {
|
||||||
switch (lib.kind) {
|
switch (lib.kind) {
|
||||||
case "plankton": {
|
case "plankton": {
|
||||||
|
const directory : string = lib_plankton.string.coin(
|
||||||
|
"{{directory}}/plankton",
|
||||||
|
{
|
||||||
|
"directory": conf.directories.libs,
|
||||||
|
}
|
||||||
|
);
|
||||||
/**
|
/**
|
||||||
* @todo outsource
|
* @todo do not use "execute" for that
|
||||||
*/
|
*/
|
||||||
const conf = {
|
await execute(
|
||||||
"directory": "libs/plankton",
|
|
||||||
};
|
|
||||||
const commands : Array<string> = [
|
|
||||||
lib_plankton.string.coin(
|
lib_plankton.string.coin(
|
||||||
"mkdir -p {{directory}}",
|
"mkdir -p {{directory}}",
|
||||||
{
|
{
|
||||||
"directory": conf.directory,
|
"directory": directory,
|
||||||
}
|
}
|
||||||
),
|
)
|
||||||
lib_plankton.string.coin(
|
);
|
||||||
"cd {{directory}}",
|
await execute(
|
||||||
{
|
|
||||||
"directory": conf.directory,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
lib_plankton.string.coin(
|
lib_plankton.string.coin(
|
||||||
"ptk bundle node {{modules}}",
|
"ptk bundle node {{modules}}",
|
||||||
{
|
{
|
||||||
"modules": lib.data.modules.join(" "),
|
"modules": lib.data.modules.join(" "),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
];
|
{
|
||||||
for (const command of commands) {
|
"working_directory": directory,
|
||||||
await execute(command);
|
}
|
||||||
}
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "node": {
|
case "node": {
|
||||||
|
@ -280,6 +282,9 @@ namespace _munin
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
/**
|
||||||
|
* @todo do not use "execute" for that
|
||||||
|
*/
|
||||||
for (const command of commands) {
|
for (const command of commands) {
|
||||||
await execute(command);
|
await execute(command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue