Skip to content

Commit 7455eef

Browse files
style(Rest): Reformat bin/Rest.js with single quotes and consistent indentation
Standardize the CLI wrapper script to use single quotes for string literals, consistent 2-space indentation, and reordered imports. The changes include converting double quotes to single quotes across all string literals, reordering imports to follow the conventional pattern (builtins first), removing unnecessary blank lines between imports, and collapsing the execSync call to a single line. These formatting adjustments align bin/Rest.js with project style conventions without altering runtime behavior.
1 parent 746022c commit 7455eef

2 files changed

Lines changed: 13 additions & 22 deletions

File tree

bin/Rest

-15.9 KB
Binary file not shown.

bin/Rest.js

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,30 @@
22
/**
33
* Rest.js - CLI wrapper for Rest compiler binary
44
*/
5-
import { execSync } from "node:child_process";
6-
import { existsSync } from "node:fs";
7-
import { dirname, join } from "node:path";
8-
import { fileURLToPath } from "node:url";
5+
6+
import { execSync } from 'node:child_process';
7+
import { join, dirname } from 'node:path';
8+
import { fileURLToPath } from 'node:url';
9+
import { existsSync } from 'node:fs';
910

1011
const __dirname = dirname(fileURLToPath(import.meta.url));
1112

1213
// Determine the binary path based on platform
1314
const platform = process.platform;
14-
15-
const binaryName = platform === "win32" ? "Rest.exe" : "Rest";
16-
15+
const binaryName = platform === 'win32' ? 'Rest.exe' : 'Rest';
1716
const binaryPath = join(__dirname, binaryName);
1817

1918
if (!existsSync(binaryPath)) {
20-
console.error(`[Rest] Binary not found at: ${binaryPath}`);
21-
22-
console.error("[Rest] Please run: npm install or npm rebuild");
23-
24-
process.exit(1);
19+
console.error(`[Rest] Binary not found at: ${binaryPath}`);
20+
console.error('[Rest] Please run: npm install or npm rebuild');
21+
process.exit(1);
2522
}
2623

2724
// Execute the binary with all arguments
2825
try {
29-
execSync(
30-
`"${binaryPath}" ${process.argv
31-
.slice(2)
32-
.map((a) => `"${a}"`)
33-
.join(" ")}`,
34-
{
35-
stdio: "inherit",
36-
},
37-
);
26+
execSync(`"${binaryPath}" ${process.argv.slice(2).map(a => `"${a}"`).join(' ')}`, {
27+
stdio: 'inherit',
28+
});
3829
} catch (error) {
39-
process.exit(error.status || 1);
30+
process.exit(error.status || 1);
4031
}

0 commit comments

Comments
 (0)