Page 1 of 1

Root directory of app

Posted: Mon Aug 19, 2024 9:40 am
by Meik
Hello,

I've created a new node.js-app. In that app I'm using jsx-scripts that are located inside of the script-folder. The paths to the jsx-scripts are set to fixed paths inside of the TypeScript-code. I want to keep them dynamic though. How can I get to that root-directory in my TypeScript-code?
Using

Code: Select all

const scriptFolder = __dirname; 
gives me the temporary script executor path ("/Applications/Enfocus/Enfocus Switch/ScriptExecutor/libs") which is of course not usable for my case since I need the original directory of the main.ts

Re: Root directory of app

Posted: Mon Aug 19, 2024 3:55 pm
by laurentd
You can add Extra files in your app, using SwitchScripter.
Then use getPluginResourcesPath() to get the path to that folder.

Re: Root directory of app

Posted: Mon Sep 02, 2024 3:54 pm
by Meik
thanks, works perfectly with the getPluginResourcesPath() function!