This commit is contained in:
2025-12-14 01:42:14 +00:00
parent 9ad5222b95
commit 5d18e53e30
10 changed files with 310 additions and 9863 deletions

View File

@@ -1,5 +1,14 @@
import * as plugins from './szci.plugins.ts';
/**
* Get current working directory (evaluated at call time, not module load time)
*/
export const getCwd = (): string => Deno.cwd();
/**
* Current working directory - use getCwd() if you need the live value after chdir
* @deprecated Use getCwd() for dynamic cwd resolution
*/
export const cwd = Deno.cwd();
// package paths
@@ -9,7 +18,13 @@ export const SzciPackageRoot = plugins.path.join(
);
export const SzciPackageConfig = plugins.path.join(SzciPackageRoot, './config.json');
// project paths
// project paths - use functions for dynamic resolution
export const getSzciProjectDir = (): string => getCwd();
export const getSzciProjectNogitDir = (): string => plugins.path.join(getCwd(), './.nogit');
export const getSzciTestDir = (): string => plugins.path.join(getCwd(), './test');
export const getSzciCacheDir = (): string => plugins.path.join(getCwd(), './.szci_cache');
// Static paths (for backwards compatibility - captured at module load)
export const SzciProjectDir = cwd;
export const SzciProjectNogitDir = plugins.path.join(SzciProjectDir, './.nogit');
export const SzciTestDir = plugins.path.join(cwd, './test');