MCPcopy Create free account
hub / github.com/chhoumann/quickadd / resolveInstanceOptions

Function resolveInstanceOptions

scripts/start-obsidian-e2e-instance.mjs:103–120  ·  view source on GitHub ↗
(rawOptions, cwd = process.cwd())

Source from the content-addressed store, hash-verified

101}
102
103export function resolveInstanceOptions(rawOptions, cwd = process.cwd()) {
104 const provisionOptions = resolveProvisionOptions(rawOptions, cwd);
105 const profileRoot = path.resolve(cwd, rawOptions.profileRoot ?? DEFAULT_PROFILE_ROOT);
106 const instanceId = stableInstanceId(provisionOptions.worktreePath, provisionOptions.vaultName);
107 const instancePath = path.join(profileRoot, instanceId);
108 const obsidianHome = path.join(instancePath, "home");
109
110 return {
111 ...provisionOptions,
112 instanceId,
113 instancePath,
114 launch: rawOptions.launch ?? true,
115 obsidianApp: rawOptions.obsidianApp ?? DEFAULT_OBSIDIAN_APP,
116 obsidianBin: rawOptions.obsidianBin ?? DEFAULT_OBSIDIAN_BIN,
117 obsidianHome,
118 profileRoot,
119 };
120}
121
122function stableInstanceId(worktreePath, vaultName) {
123 const hash = crypto

Callers 4

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.85

Calls 3

resolveProvisionOptionsFunction · 0.90
stableInstanceIdFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected