Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

756 B
Raw Blame
import path from 'path';
import { fileURLToPath } from 'url';

// Convert the current module URL to a file path
const currentModulePath = fileURLToPath(import.meta.url);

// Resolve the parent directory of the current module
export const packageDirectory = path.join(
  path.dirname(currentModulePath),
  '..',
);
export let npmDirectory = packageDirectory;

export let tauriConfigDirectory = path.join(npmDirectory, 'src-tauri', '.pake');

// A CLI invocation owns one build workspace. Keep template resolution separate
// from generated paths so packaging never rewrites the installed package.
export function setBuildDirectory(directory: string): void {
  npmDirectory = directory;
  tauriConfigDirectory = path.join(directory, 'src-tauri', '.pake');
}