Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
"yargs": "^17.7.2"
},
"browserslist": "cover 100%,not android < 5"
}
}
17 changes: 14 additions & 3 deletions src/lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ async function run(
const uuid = helpers.uuid();

let isLoading = false;
let isFallback = false;
let filename, pathName, extension;
let port = appSettings.value.serverPort;
let EXECUTING_SCRIPT = uuid + "_script.js";
Expand Down Expand Up @@ -252,7 +253,7 @@ async function run(

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

if (pathName) {
if (pathName && isFallback) {
const projectFolder = addedFolder[0];

//set the root folder to the file parent if no project folder is set
Expand Down Expand Up @@ -474,10 +475,20 @@ async function run(
* @returns
*/
async function sendFileContent(url, id, mime, processText) {
const fs = fsOperation(url);
let fs = fsOperation(url);

if (!(await fs.exists())) {
error(id);
const xfs = fsOperation(Url.join(pathName, filename));

if (await xfs.exists()) {
fs = xfs;
isFallback = true;
console.log(`fallback ${Url.join(pathName, filename)}`);
} else {
console.log(`${url} doesnt exists`);
error(id);
}

return;
}

Expand Down
10 changes: 5 additions & 5 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,17 @@

<title>Acode</title>
<!--styles-->
<link rel="stylesheet" href="./css/build/218.css">
<link rel="stylesheet" href="./css/build/32.css">
<link rel="stylesheet" href="./css/build/383.css">
<link rel="stylesheet" href="./css/build/53.css">
<link rel="stylesheet" href="./css/build/609.css">
<link rel="stylesheet" href="./css/build/about.css">
<link rel="stylesheet" href="./css/build/customTheme.css">
<link rel="stylesheet" href="./css/build/donate.css">
<link rel="stylesheet" href="./css/build/fileBrowser.css">
<link rel="stylesheet" href="./css/build/main.css">
<link rel="stylesheet" href="./css/build/plugins.css">
<link rel="stylesheet" href="./css/build/src_pages_quickTools_quickTools_js.css">
<link rel="stylesheet" href="./css/build/src_sidebarApps_extensions_index_js.css">
<link rel="stylesheet" href="./css/build/src_sidebarApps_files_index_js.css">
<link rel="stylesheet" href="./css/build/src_sidebarApps_notification_index_js.css">
<link rel="stylesheet" href="./css/build/src_sidebarApps_searchInFiles_index_js.css">
<link rel="stylesheet" href="./css/build/themeSetting.css">
<!--styles_end-->
</head>
Expand Down