(rawOptions, cwd = process.cwd())
| 101 | } |
| 102 | |
| 103 | export 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 | |
| 122 | function stableInstanceId(worktreePath, vaultName) { |
| 123 | const hash = crypto |
no test coverage detected