sandbox setting and argument (#243)

This commit is contained in:
Olcan
2025-05-02 08:15:46 -07:00
committed by GitHub
parent 53ac7952c7
commit a7679db6e9
6 changed files with 44 additions and 23 deletions

View File

@@ -21,18 +21,15 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
async function main() {
const config = await loadCliConfig();
const settings = loadSettings(config);
const theme = settings.getMerged().theme;
if (theme) {
themeManager.setActiveTheme(theme);
const settings = loadSettings(process.cwd());
const config = await loadCliConfig(settings.merged);
if (settings.merged.theme) {
themeManager.setActiveTheme(settings.merged.theme);
}
let input = config.getQuestion();
// hop into sandbox if we are outside and sandboxing is enabled
if (!process.env.SANDBOX) {
const sandbox = sandbox_command();
const sandbox = sandbox_command(config.getSandbox());
if (sandbox) {
console.log('hopping into sandbox ...');
await start_sandbox(sandbox);
@@ -40,6 +37,8 @@ async function main() {
}
}
let input = config.getQuestion();
// Render UI, passing necessary config values. Check that there is no command line question.
if (process.stdin.isTTY && input?.length === 0) {
const readUpResult = await readPackageUp({ cwd: __dirname });