Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Aug 18, 2024
1 parent 53d8474 commit 787eceb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
15 changes: 9 additions & 6 deletions Source/Class/Pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ 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 @@ -31,9 +33,10 @@ 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: 1 addition & 3 deletions Source/Function/By.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
*/
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: 12 additions & 11 deletions Source/Function/Pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,24 @@ 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 787eceb

Please sign in to comment.