Skip to content

Commit da603e9

Browse files
fix(setup): restore default stopped installs
1 parent 9984a7a commit da603e9

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

packages/sim-setup/src/context.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ describe('resolveSetupContext', () => {
5555
})
5656
})
5757

58+
it('finds an existing installation in the default child directory', () => {
59+
const root = tempRoot()
60+
const installRoot = path.join(root, 'sim')
61+
mkdirSync(installRoot)
62+
writeFileSync(
63+
path.join(installRoot, 'docker-compose.prod.yml'),
64+
'image: ghcr.io/simstudioai/simstudio:latest\n'
65+
)
66+
67+
expect(resolveSetupContext(root, [])).toEqual({
68+
kind: 'standalone',
69+
root: installRoot,
70+
existing: true,
71+
})
72+
})
73+
5874
it('fails on a partial Sim checkout', () => {
5975
const root = tempRoot()
6076
writePackage(root, 'package.json', 'simstudio')

packages/sim-setup/src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function resolveSetupContext(
112112
}
113113
}
114114

115-
return { kind: 'standalone', root: path.join(path.resolve(start), 'sim'), existing: false }
115+
return resolveSetupContextAtRoot(path.join(path.resolve(start), 'sim'))
116116
}
117117

118118
export const SETUP_CONTEXT = resolveSetupContext()

0 commit comments

Comments
 (0)