Skip to content

Commit f567d88

Browse files
authored
Merge pull request #172 from masx200/format-updates
format
2 parents 70bbd22 + c365485 commit f567d88

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

cache.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (import.meta.main) {
2222

2323
async function parallel_cache(
2424
entry_iter: AsyncIterableIterator<WalkEntry>,
25-
limiter: AsyncCurrentLimiter,
25+
limiter: AsyncCurrentLimiter
2626
) {
2727
const files: string[] = [];
2828

@@ -37,20 +37,21 @@ async function parallel_cache(
3737
limiter.run(
3838
function (stack: string[]) {
3939
return runDenocache(stack);
40-
}.bind(null, stack),
40+
}.bind(null, stack)
4141
)
42-
),
42+
)
4343
);
4444
}
4545
async function start() {
4646
const limiter = new AsyncLimiterClass(1);
4747
const args = parse(Deno.args);
4848
console.log(args);
49-
const skip = typeof args.skip === "string"
50-
? new RegExp(String(args.skip))
51-
: Array.isArray(args.skip)
52-
? args.skip.map((s: string | RegExp) => new RegExp(s))
53-
: undefined;
49+
const skip =
50+
typeof args.skip === "string"
51+
? new RegExp(String(args.skip))
52+
: Array.isArray(args.skip)
53+
? args.skip.map((s: string | RegExp) => new RegExp(s))
54+
: undefined;
5455
const entry_iter = searchFilesNames({ skip });
5556
await parallel_cache(entry_iter, limiter);
5657
}
@@ -72,7 +73,7 @@ async function runDenocache(stack: string[]) {
7273
if (!success) {
7374
throw new Error(
7475
"type cache failed:" +
75-
JSON.stringify({ code, success, stdout: out, stderr: err }),
76+
JSON.stringify({ code, success, stdout: out, stderr: err })
7677
);
7778
}
7879
}

check.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (import.meta.main) {
2222

2323
async function parallel_check(
2424
entry_iter: AsyncIterableIterator<WalkEntry>,
25-
limiter: AsyncCurrentLimiter,
25+
limiter: AsyncCurrentLimiter
2626
) {
2727
const files: string[] = [];
2828

@@ -37,20 +37,21 @@ async function parallel_check(
3737
limiter.run(
3838
function (stack: string[]) {
3939
return runDenoCheck(stack);
40-
}.bind(null, stack),
40+
}.bind(null, stack)
4141
)
42-
),
42+
)
4343
);
4444
}
4545
async function start() {
4646
const limiter = new AsyncLimiterClass(navigator.hardwareConcurrency);
4747
const args = parse(Deno.args);
4848
console.log(args);
49-
const skip = typeof args.skip === "string"
50-
? new RegExp(String(args.skip))
51-
: Array.isArray(args.skip)
52-
? args.skip.map((s: string | RegExp) => new RegExp(s))
53-
: undefined;
49+
const skip =
50+
typeof args.skip === "string"
51+
? new RegExp(String(args.skip))
52+
: Array.isArray(args.skip)
53+
? args.skip.map((s: string | RegExp) => new RegExp(s))
54+
: undefined;
5455
const entry_iter = searchFilesNames({ skip });
5556
await parallel_check(entry_iter, limiter);
5657
}
@@ -72,7 +73,7 @@ async function runDenoCheck(stack: string[]) {
7273
if (!success) {
7374
throw new Error(
7475
"type cache failed:" +
75-
JSON.stringify({ code, success, stdout: out, stderr: err }),
76+
JSON.stringify({ code, success, stdout: out, stderr: err })
7677
);
7778
}
7879
}

retry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function retry<T>(
1515
retryOnError?:
1616
| ((error: any) => Promise<boolean>)
1717
| ((error: any) => boolean);
18-
},
18+
}
1919
) {
2020
const retryOnError = opts?.retryOnError ?? (() => true);
2121
const options: Required<RetryOptions> = {

xmake.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { retry } from "./retry.ts";
66

77
async function* findFilesRecursive(
88
path: string,
9-
name: string,
9+
name: string
1010
): AsyncGenerator<string, void, unknown> {
1111
for await (const entry of Deno.readDir(path)) {
1212
const fullPath = resolve(join(path, entry.name));
@@ -37,7 +37,7 @@ async function RunXmake(
3737
sdk: string,
3838
executable: string,
3939
group: string,
40-
mode: string,
40+
mode: string
4141
) {
4242
await RunXmakeConfig(file, toolchain, sdk, executable, mode);
4343
await retry(RunXmakeBuild.bind(null, file, executable, group), {
@@ -50,11 +50,11 @@ async function RunXmake(
5050
const cwd = path.dirname(file);
5151
const dirtobecreate = path.join(
5252
cwd,
53-
path.dirname(filepathmatched),
53+
path.dirname(filepathmatched)
5454
);
5555

5656
console.log(
57-
"Ensures that the directory exists:" + dirtobecreate,
57+
"Ensures that the directory exists:" + dirtobecreate
5858
);
5959
await ensureDir(dirtobecreate);
6060
return true;
@@ -69,7 +69,7 @@ async function RunXmakeConfig(
6969
toolchain: string,
7070
sdk: string,
7171
executable: string,
72-
mode: string,
72+
mode: string
7373
) {
7474
console.log({ file });
7575
const cwd = path.dirname(file);
@@ -88,9 +88,10 @@ export async function RunCommandShell(others: string[], cwd?: string) {
8888

8989
const cmd = os === "windows" ? "powershell.exe" : "bash";
9090

91-
const args = os === "windows"
92-
? ["-command", others.join(" \n ")]
93-
: ["-c", others.join(" && ")];
91+
const args =
92+
os === "windows"
93+
? ["-command", others.join(" \n ")]
94+
: ["-c", others.join(" && ")];
9495

9596
console.log(JSON.stringify({ cmd, cwd, args }));
9697
const command = new Deno.Command(cmd, { cwd: cwd, args });

0 commit comments

Comments
 (0)