mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-16 18:25:59 +00:00
Update ExecService.js
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / backend (node env, api-test) (22.x) (push) Has been cancelled
test / puterjs (browser env, playwright) (22.x) (push) Has been cancelled
test / puterjs (node env, vitest) (22.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / backend (node env, api-test) (22.x) (push) Has been cancelled
test / puterjs (browser env, playwright) (22.x) (push) Has been cancelled
test / puterjs (node env, vitest) (22.x) (push) Has been cancelled
This commit is contained in:
@@ -116,6 +116,7 @@ export class ExecService extends Service {
|
||||
// Check if file_paths are provided and caller has godmode permissions
|
||||
if (file_paths && Array.isArray(file_paths) && file_paths.length > 0 && process) {
|
||||
try {
|
||||
console.log('file_paths', file_paths);
|
||||
// Get caller app info to check godmode status
|
||||
const caller_app_name = process.name;
|
||||
const caller_app_info = await window.get_apps(caller_app_name);
|
||||
@@ -129,8 +130,13 @@ export class ExecService extends Service {
|
||||
|
||||
// For the first file, create a file signature and set it up like opening a file
|
||||
if (file_paths.length > 0) {
|
||||
const first_file_path = file_paths[0];
|
||||
|
||||
let first_file_path = file_paths[0];
|
||||
|
||||
// resolve tilde to home path (i.e. ~/Desktop/file.txt -> /[username]/Desktop/file.txt)
|
||||
if(first_file_path.startsWith('~/'))
|
||||
first_file_path = window.home_path + first_file_path.slice(1);
|
||||
|
||||
|
||||
try {
|
||||
// Get file stats to verify it exists
|
||||
const file_stat = await puter.fs.stat({path: first_file_path, consistency: 'eventual'});
|
||||
|
||||
Reference in New Issue
Block a user