Skip to content

Commit d0cdf70

Browse files
committed
Rename binaries approriately
1 parent 20fb1d2 commit d0cdf70

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/cli/src/command-helpers/local-node.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function getPlatformBinaryName(): string {
1515
if (platform === 'linux' && arch === 'x64') return 'gnd-linux-x86_64.gz';
1616
if (platform === 'linux' && arch === 'arm64') return 'gnd-linux-aarch64.gz';
1717
if (platform === 'darwin' && arch === 'x64') return 'gnd-macos-x86_64.gz';
18-
if (platform === 'darwin' && arch === 'arm64') return 'gnd-windows-x86_64.exe.zip'; //'gnd-macos-aarch64.gz';
18+
if (platform === 'darwin' && arch === 'arm64') return 'gnd-macos-aarch64.gz';
1919
if (platform === 'win32' && arch === 'x64') return 'gnd-windows-x86_64.exe.zip';
2020

2121
throw new Error(`Unsupported platform: ${platform} ${arch}`);
@@ -144,10 +144,13 @@ export async function extractZipAndGetExe(zipPath: string, outputDir: string): P
144144

145145
export async function moveFileToBinDir(srcPath: string, binDir?: string): Promise<string> {
146146
const targetDir = binDir || (await getGlobalBinDir());
147-
const destPath = path.join(targetDir, path.basename(srcPath));
147+
const platform = os.platform();
148+
const binaryName = platform === 'win32' ? 'gnd.exe' : 'gnd';
149+
const destPath = path.join(targetDir, binaryName);
148150
await fs.promises.rename(srcPath, destPath);
149151
return destPath;
150152
}
153+
151154
export async function moveFile(srcPath: string, destPath: string): Promise<string> {
152155
await fs.promises.rename(srcPath, destPath);
153156
return destPath;

0 commit comments

Comments
 (0)