filemanager: open terminal in cwd

This commit is contained in:
Girish Ramakrishnan
2026-02-12 20:26:14 +01:00
parent c5cf8eef1a
commit ae09c19b69
4 changed files with 11 additions and 3 deletions
+3 -1
View File
@@ -838,9 +838,11 @@ async function createExec(req, res, next) {
if ('lang' in req.body && typeof req.body.lang !== 'string') return next(new HttpError(400, 'lang must be a string'));
if ('cwd' in req.body && typeof req.body.cwd !== 'string') return next(new HttpError(400, 'cwd must be a string'));
if (safe.query(req.resources.app, 'manifest.addons.docker') && req.user.role !== users.ROLE_OWNER) return next(new HttpError(403, '"owner" role is requied to exec app with docker addon'));
const [error, id] = await safe(apps.createExec(req.resources.app, { cmd, tty, lang: req.body.lang }));
const [error, id] = await safe(apps.createExec(req.resources.app, { cmd, tty, lang: req.body.lang, cwd: req.body.cwd }));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { id }));