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 9905fef commit d34b756
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 99 deletions.
25 changes: 11 additions & 14 deletions Source/Command/Cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default async () =>
for (const [_Directory, FilesPackage] of await (
await import("@Function/Directory.js")
).default(
await (
await import("@Function/Package.js")
).default("Cloudflare"),
await (await import("@Function/Package.js")).default(
"Cloudflare",
),
)) {
const GitHub = `${_Directory}/.github`;
const Base = await File();
Expand Down Expand Up @@ -51,9 +51,7 @@ export default async () =>
let Branch = "main";

try {
await (
await import("fs/promises")
).access(
await (await import("fs/promises")).access(
_Directory,
(await import("fs/promises")).constants.F_OK,
);
Expand All @@ -74,19 +72,18 @@ export default async () =>

if (Base.size > 1) {
try {
await (
await import("fs/promises")
).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`.replaceAll(
"$Branch$",
Expand Down
15 changes: 7 additions & 8 deletions Source/Command/Dependabot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,18 @@ export default async () =>

if (Base.size > 0) {
try {
await (
await import("fs/promises")
).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`,
);
Expand Down
15 changes: 7 additions & 8 deletions Source/Command/GitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ export default async () =>

if (Base.size > 0) {
try {
await (
await import("fs/promises")
).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`,
);
Expand Down
15 changes: 7 additions & 8 deletions Source/Command/NPM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,18 @@ export default async () =>

if (Base.size > 1) {
try {
await (
await import("fs/promises")
).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`,
);
Expand Down
19 changes: 8 additions & 11 deletions Source/Command/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ export default async () =>
let Branch = "main";

try {
await (
await import("fs/promises")
).access(
await (await import("fs/promises")).access(
_Directory,
(await import("fs/promises")).constants.F_OK,
);
Expand All @@ -174,19 +172,18 @@ export default async () =>

if (Base.size > 1) {
try {
await (
await import("fs/promises")
).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`.replaceAll(
"$Branch$",
Expand Down
19 changes: 8 additions & 11 deletions Source/Command/Rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export default async () =>
let Branch = "main";

try {
await (
await import("fs/promises")
).access(
await (await import("fs/promises")).access(
_Directory,
(await import("fs/promises")).constants.F_OK,
);
Expand All @@ -82,19 +80,18 @@ export default async () =>

if (Base.size > 1) {
try {
await (
await import("fs/promises")
).mkdir(`${GitHub}${Path}`, {
recursive: true,
});
await (await import("fs/promises")).mkdir(
`${GitHub}${Path}`,
{
recursive: true,
},
);
} catch {
console.log(`Could not create: ${GitHub}${Path}`);
}

try {
await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
`${GitHub}${Path}${Name}`,
`${[...Base].join("")}`.replaceAll(
"$Branch$",
Expand Down
17 changes: 9 additions & 8 deletions Source/Command/Star.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
export default async () => {
const Dependency = new Set<string>();

for (const Package of await (
await import("fast-glob")
).default(["**/package.json", "!**/node_modules"], {
absolute: true,
cwd: (await import("@Variable/Environment.js")).default.parse(
process.env,
).Base,
})) {
for (const Package of await (await import("fast-glob")).default(
["**/package.json", "!**/node_modules"],
{
absolute: true,
cwd: (await import("@Variable/Environment.js")).default.parse(
process.env,
).Base,
},
)) {
const _JSON = JSON.parse(
(
await (await import("fs/promises")).readFile(Package, "utf-8")
Expand Down
6 changes: 3 additions & 3 deletions Source/Function/Readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default async () =>
await import("fast-glob")
).default(["**/README.md"], {
absolute: true,
cwd: (await import("@Variable/Environment.js")).default.parse(
process.env,
).Base,
cwd: (
await import("@Variable/Environment.js")
).default.parse(process.env).Base,
})),
].sort(),
);
7 changes: 4 additions & 3 deletions Source/Function/WalkUntilGit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export const _Function = (async (...[Search, From]: Parameters<Interface>) => {
}

try {
await (
await import("fs/promises")
).access(`${Path}/.git`, (await import("fs/promises")).constants.R_OK);
await (await import("fs/promises")).access(
`${Path}/.git`,
(await import("fs/promises")).constants.R_OK,
);

return Path;
} catch (_Error) {
Expand Down
14 changes: 9 additions & 5 deletions Source/Variable/Cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export default new Set([
await (
await import("fs/promises")
).readFile(
(await import("path")).resolve(
`${(await import("path")).dirname(
(await import("url")).fileURLToPath(
import.meta.url,
),
(
await import("path")
).resolve(
`${(
await import("path")
).dirname(
(
await import("url")
).fileURLToPath(import.meta.url),
)}/../../Workflow/Cloudflare.yml`,
),
"utf-8",
Expand Down
14 changes: 9 additions & 5 deletions Source/Variable/GitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export default new Set([
await (
await import("fs/promises")
).readFile(
(await import("path")).resolve(
`${(await import("path")).dirname(
(await import("url")).fileURLToPath(
import.meta.url,
),
(
await import("path")
).resolve(
`${(
await import("path")
).dirname(
(
await import("url")
).fileURLToPath(import.meta.url),
)}/../../Workflow/GitHub.yml`,
),
"utf-8",
Expand Down
14 changes: 9 additions & 5 deletions Source/Variable/NPM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export default new Set([
await (
await import("fs/promises")
).readFile(
(await import("path")).resolve(
`${(await import("path")).dirname(
(await import("url")).fileURLToPath(
import.meta.url,
),
(
await import("path")
).resolve(
`${(
await import("path")
).dirname(
(
await import("url")
).fileURLToPath(import.meta.url),
)}/../../Workflow/NPM.yml`,
),
"utf-8",
Expand Down
14 changes: 9 additions & 5 deletions Source/Variable/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export default new Set([
await (
await import("fs/promises")
).readFile(
(await import("path")).resolve(
`${(await import("path")).dirname(
(await import("url")).fileURLToPath(
import.meta.url,
),
(
await import("path")
).resolve(
`${(
await import("path")
).dirname(
(
await import("url")
).fileURLToPath(import.meta.url),
)}/../../Workflow/Node.yml`,
),
"utf-8",
Expand Down
14 changes: 9 additions & 5 deletions Source/Variable/Rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export default new Set([
await (
await import("fs/promises")
).readFile(
(await import("path")).resolve(
`${(await import("path")).dirname(
(await import("url")).fileURLToPath(
import.meta.url,
),
(
await import("path")
).resolve(
`${(
await import("path")
).dirname(
(
await import("url")
).fileURLToPath(import.meta.url),
)}/../../Workflow/Rust.yml`,
),
"utf-8",
Expand Down

0 comments on commit d34b756

Please sign in to comment.