Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Jul 27, 2024
1 parent 016100b commit 7bcd89b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
15 changes: 6 additions & 9 deletions Source/Class/Pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ export default class implements Interface {
};

By = async (...[File]: Parameters<Interface["By"]>) => {
this.Plan.Results = await (await import("@Function/By.js")).default(
File,
this.Plan.Paths,
this.Plan.Results,
);
this.Plan.Results = await (
await import("@Function/By.js")
).default(File, this.Plan.Paths, this.Plan.Results);

return this;
};
Expand All @@ -33,10 +31,9 @@ export default class implements Interface {
};

Pipe = async (...[_Action]: Parameters<Interface["Pipe"]>) => {
this.Plan = await (await import("@Function/Pipe.js")).default(
this.Plan,
Merge(Action, _Action ?? {}),
);
this.Plan = await (
await import("@Function/Pipe.js")
).default(this.Plan, Merge(Action, _Action ?? {}));

return this;
};
Expand Down
4 changes: 3 additions & 1 deletion Source/Function/By.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*/
export default (async (...[File, Paths, Results]: Parameters<Interface>) => {
for (const [Input, Output] of Paths) {
for (const Result of await (await import("fast-glob")).default(File, {
for (const Result of await (
await import("fast-glob")
).default(File, {
cwd: Input ?? (await import("process")).cwd(),
onlyFiles: true,
})) {
Expand Down
23 changes: 11 additions & 12 deletions Source/Function/Pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@ export default (async (

if (Passed && (await Passed(Plan.On))) {
try {
await (await import("fs/promises")).access(
await (
await import("fs/promises")
).access(
dirname(Plan.On.Output),
(await import("fs/promises")).constants.W_OK,
);
} catch (_Error) {
await (await import("fs/promises")).mkdir(
dirname(Plan.On.Output),
{
recursive: true,
},
);
await (
await import("fs/promises")
).mkdir(dirname(Plan.On.Output), {
recursive: true,
});
}

await (await import("fs/promises")).writeFile(
Plan.On.Output,
Plan.On.Buffer,
"utf-8",
);
await (
await import("fs/promises")
).writeFile(Plan.On.Output, Plan.On.Buffer, "utf-8");

Plan.On.After = (await stat(Plan.On.Output)).size;

Expand Down

0 comments on commit 7bcd89b

Please sign in to comment.