Spaces:
Sleeping

File size: 655 Bytes
097eaf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { platform } from "os";
import { join } from "path";

const currentPlatform = platform();
const isWindows = currentPlatform === "win32";

const EXTENSIONS = {
  win32: ".dll",
  darwin: ".dylib",
  default: ".so",
} as const;

function createNativePath(subPath: string, filename: string): string {
  const extension =
    EXTENSIONS[currentPlatform as keyof typeof EXTENSIONS] ??
    EXTENSIONS.default;
  const fullFilename = `${isWindows ? "" : "lib"}${filename}${extension}`;
  return join(process.cwd(), "sharedLibs", subPath, fullFilename);
}

export const HTML_TO_MARKDOWN_PATH = createNativePath(
  "go-html-to-md",
  "html-to-markdown",
);