@deskthing/cli
Version:
An emulator for the DeskThing Server
10 lines (8 loc) • 398 B
text/typescript
import { existsSync } from "node:fs";
import { join } from "node:path";
export const getReleaseFilePath = async (fileId: string): Promise<string> => {
const distPath = join(process.cwd(), 'dist');
const defaultPath = join(distPath, 'latest.json');
const appSpecificPath = join(distPath, `${fileId}.json`);
return existsSync(defaultPath) ? appSpecificPath : defaultPath;
}