mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
ext push now save folder correctly
This commit is contained in:
parent
fcb876695d
commit
87d6c18254
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -421,7 +421,11 @@ export function initElectron(): void {
|
|||||||
|
|
||||||
function initWebserver(): void {
|
function initWebserver(): void {
|
||||||
(document as any).saveFile = function (filename: string, code: string): string {
|
(document as any).saveFile = function (filename: string, code: string): string {
|
||||||
// filename = removeLeadingSlash(filename);
|
delete localStorage["scriptEditorOpenScripts"];
|
||||||
|
delete localStorage["scriptEditorCurrentScript"];
|
||||||
|
if (removeLeadingSlash(filename).includes("/")) {
|
||||||
|
filename = "/" + removeLeadingSlash(filename);
|
||||||
|
}
|
||||||
console.log(code);
|
console.log(code);
|
||||||
code = Buffer.from(code, "base64").toString();
|
code = Buffer.from(code, "base64").toString();
|
||||||
console.log(code);
|
console.log(code);
|
||||||
@ -431,7 +435,6 @@ function initWebserver(): void {
|
|||||||
if (isScriptFilename(filename)) {
|
if (isScriptFilename(filename)) {
|
||||||
//If the current script already exists on the server, overwrite it
|
//If the current script already exists on the server, overwrite it
|
||||||
for (let i = 0; i < home.scripts.length; i++) {
|
for (let i = 0; i < home.scripts.length; i++) {
|
||||||
console.log(`${filename} ${home.scripts[i].filename}`);
|
|
||||||
if (filename == home.scripts[i].filename) {
|
if (filename == home.scripts[i].filename) {
|
||||||
home.scripts[i].saveScript(filename, code, "home", home.scripts);
|
home.scripts[i].saveScript(filename, code, "home", home.scripts);
|
||||||
return "written";
|
return "written";
|
||||||
|
Loading…
Reference in New Issue
Block a user