Skip to content

Commit 39184f2

Browse files
fix. file not found error
1 parent 52b34d2 commit 39184f2

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@
113113
"yargs": "^17.7.2"
114114
},
115115
"browserslist": "cover 100%,not android < 5"
116-
}
116+
}

src/lib/run.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ async function run(
6060
const uuid = helpers.uuid();
6161

6262
let isLoading = false;
63+
let isFallback = false
6364
let filename, pathName, extension;
6465
let port = appSettings.value.serverPort;
6566
let EXECUTING_SCRIPT = uuid + "_script.js";
@@ -252,7 +253,7 @@ async function run(
252253

253254
let file = activeFile.SAFMode === "single" ? activeFile : null;
254255

255-
if (pathName) {
256+
if (pathName && isFallback) {
256257
const projectFolder = addedFolder[0];
257258

258259
//set the root folder to the file parent if no project folder is set
@@ -474,10 +475,20 @@ async function run(
474475
* @returns
475476
*/
476477
async function sendFileContent(url, id, mime, processText) {
477-
const fs = fsOperation(url);
478+
let fs = fsOperation(url);
478479

479480
if (!(await fs.exists())) {
481+
const xfs = fsOperation(Url.join(pathName,filename))
482+
483+
if(await xfs.exists()){
484+
fs = xfs
485+
isFallback = true
486+
console.log(`fallback ${Url.join(pathName,filename)}`)
487+
}else{
488+
console.log(`${url} doesnt exists`)
480489
error(id);
490+
}
491+
481492
return;
482493
}
483494

www/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,17 @@
165165

166166
<title>Acode</title>
167167
<!--styles-->
168-
<link rel="stylesheet" href="./css/build/218.css">
169-
<link rel="stylesheet" href="./css/build/32.css">
170-
<link rel="stylesheet" href="./css/build/383.css">
171-
<link rel="stylesheet" href="./css/build/53.css">
172-
<link rel="stylesheet" href="./css/build/609.css">
173168
<link rel="stylesheet" href="./css/build/about.css">
174169
<link rel="stylesheet" href="./css/build/customTheme.css">
175170
<link rel="stylesheet" href="./css/build/donate.css">
176171
<link rel="stylesheet" href="./css/build/fileBrowser.css">
177172
<link rel="stylesheet" href="./css/build/main.css">
178173
<link rel="stylesheet" href="./css/build/plugins.css">
174+
<link rel="stylesheet" href="./css/build/src_pages_quickTools_quickTools_js.css">
175+
<link rel="stylesheet" href="./css/build/src_sidebarApps_extensions_index_js.css">
176+
<link rel="stylesheet" href="./css/build/src_sidebarApps_files_index_js.css">
177+
<link rel="stylesheet" href="./css/build/src_sidebarApps_notification_index_js.css">
178+
<link rel="stylesheet" href="./css/build/src_sidebarApps_searchInFiles_index_js.css">
179179
<link rel="stylesheet" href="./css/build/themeSetting.css">
180180
<!--styles_end-->
181181
</head>

0 commit comments

Comments
 (0)