Skip to content

Commit 4649e0a

Browse files
committed
FIX BROKEN INCLUDE AFTER COMPILE ?
1 parent e725042 commit 4649e0a

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ global.currentConfiguration = {}
1818

1919

2020

21-
eval(require('fs').readFileSync('versioncheck.js')+'');
21+
eval(require('fs').readFileSync(__dirname+'/versioncheck.js')+'');
2222

2323

2424
var tools = require("./tools")

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sidenoder",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"description": "SideNoder",
55
"main": "main.js",
66
"dependencies": {

tools.js

+17-14
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ const configLocation = require('path').join(homedir, "sidenoder-config.json")
1919

2020
if (`${platform}` != "win64" && `${platform}` != "win32") {
2121
global.nullcmd = "> /dev/null"
22+
global.nullerror = "2> /dev/null"
2223
} else {
2324
global.nullcmd = "> null"
25+
global.nullerror = "2> null"
2426
}
2527

2628

@@ -111,12 +113,15 @@ function execShellCommand(cmd, buffer = 5000) {
111113
return new Promise((resolve, reject) => {
112114
exec(cmd, {maxBuffer: 1024 * buffer}, (error, stdout, stderr) => {
113115
if (error) {
114-
console.warn(error);
116+
console.log('exec_error')
117+
//console.warn(error);
115118
}
116119
if (stdout) {
120+
console.log('exec_stdout')
117121
console.log(stdout)
118122
resolve(stdout);
119123
} else {
124+
console.log('exec_stderr')
120125
console.log(stderr)
121126
resolve(stderr);
122127
}
@@ -226,22 +231,22 @@ async function mount(){
226231

227232

228233
if (`${global.platform}` != "win64" && `${global.platform}` != "win32") {
229-
await execShellCommand(`umount ${mountFolder}`);
230-
await execShellCommand(`fusermount -uz ${mountFolder}`);
231-
console.log(mountFolder);
234+
await execShellCommand(`umount ${mountFolder} ${global.nullerror}`);
235+
await execShellCommand(`fusermount -uz ${mountFolder} ${global.nullerror}`);
232236
await fs.mkdir(mountFolder, {}, ()=>{}) // folder must exist on windows
233-
console.log(mountFolder);
234237
}
238+
235239
if (`${global.platform}` == "win64" || `${global.platform}` == "win32") {
236-
await execShellCommand(`rmdir "${mountFolder}"`); // folder must NOT exist on windows
240+
await execShellCommand(`rmdir "${mountFolder}" ${global.nullerror}`); // folder must NOT exist on windows
237241
}
242+
238243
let content = await fetch("https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/main/extras/k")
239244
content = await content.text()
240245
let buff = Buffer.from(content, 'base64');
241246
const key = buff.toString('ascii');
242247

243248
kpath = require('path').join(tmpdir, "k")
244-
console.log(kpath)
249+
//console.log(kpath)
245250
fs.writeFileSync(kpath, key)
246251

247252

@@ -252,11 +257,11 @@ async function mount(){
252257

253258
config = config.replace("XXX", kpath);
254259
cpath = require('path').join(tmpdir, "c")
255-
console.log(cpath)
260+
//console.log(cpath)
256261

257262
fs.writeFileSync(cpath, config)
258263

259-
console.log("voor")
264+
//console.log("voor")
260265

261266
if (`${platform}` === "darwin") {
262267
var mountCmd = "cmount"
@@ -279,7 +284,7 @@ async function mount(){
279284
console.log(`stdout: ${stdout}`);
280285
});
281286

282-
console.log("na")
287+
//console.log("na")
283288
}
284289

285290

@@ -681,21 +686,19 @@ function updateRcloneProgress() {
681686
}
682687

683688
function reloadConfig() {
684-
console.log(configLocation)
685689
const defaultConfig = {autoMount: false};
686690
try {
687691
if (fs.existsSync(configLocation)) {
688-
console.log("Config exist, using");
692+
console.log("Config exist, using " + configLocation);
689693
global.currentConfiguration = require(configLocation);
690694
} else {
691-
console.log("Config doesnt exist, creating");
695+
console.log("Config doesnt exist, creating ") + configLocation;
692696
fs.writeFileSync(configLocation, JSON.stringify(defaultConfig))
693697
global.currentConfiguration = defaultConfig;
694698
}
695699
} catch(err) {
696700
console.error(err);
697701
}
698-
console.log(global.currentConfiguration);
699702
}
700703

701704

0 commit comments

Comments
 (0)