This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
We are using CCS v7.4.0. Our workspace structure has a JVScript folder two levels beneath the CCS workspace folder, and one level below the CCS project folder. When I run JavaScript files using DSS in a CMD console, I can execute "cd <absolute_path>\JVScript". When I run the main script from there, DSS can find all subordinate scripts relative to that folder.
I recently tried for the first time executing scripts out of that JVScript folder from the CCS Scripting Console.I can use the loadJSFIle command to load the top level JS file using an absolute path. That script immediately begins executing, and fails because it cannot find the subordinate JS script specified in a load() call at the start of the script. The subordinate script file is located in the same folder as the top level script file. So this raises a few questions.
If Scripting Console can find and begin to execute the top level script file specified by an absolute path in a loadJSFile command, why can't it find subordinate script files in the same folder?
Is there a way within Scripting Console to set a current working folder from which other subordinate scripts can be loaded? I have examined related past e2e threads. The latest threads I could find date from 2013-2015, and the conclusion is that Scripting Console has no concept of a current working folder, and cannot use relative paths. Has that been improved in the 4 years since those threads were closed?
We have a very complex script infrastructure. It would be completely unworkable to require each script to specify an absolute path to every JS file accessed via calls to load().. Especially since the path changes for each different workspace for every SVN branch for the rapidly evolving versions of our project, and every team member has a different absolute path to his/her local SVN repository.
Can anyone who has encountered this limitation suggest a workable solution they have found?
Hello Thomas,
Thomas Cox30 said:I have examined related past e2e threads. The latest threads I could find date from 2013-2015, and the conclusion is that Scripting Console has no concept of a current working folder, and cannot use relative paths. Has that been improved in the 4 years since those threads were closed?
Unfortunately, no. Nothing has changed in this regard.
Thomas Cox30 said:We have a very complex script infrastructure. It would be completely unworkable to require each script to specify an absolute path to every JS file accessed via calls to load().. Especially since the path changes for each different workspace for every SVN branch for the rapidly evolving versions of our project, and every team member has a different absolute path to his/her local SVN repository.
Can anyone who has encountered this limitation suggest a workable solution they have found?
I have worked around this in the past by using a environment variables, which is set to the current working folder. Perhaps there is a better way. If others have better suggestions, I'd love to hear it also.
Thanks
ki