mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 23:38:35 +02:00
#1773 - Fix duplicate file extensions
For some time now, filenames have included the extension, so there's no need to append ".js" either on a single-file download or zip download. While I was in the area, I also fixed .txt files in a folder - they had the same bug as scripts used to (appear in the zip as an underscore). I consolidated the code since it was the same for script files and text files. I also added the ability to download *.js and *.ns (previously only supported *, *.script, and *.txt) I also made the wildcard matching just a bit more flexible, so if someone really wanted to, they could go "download *blah.js" and get all scripts ending with that pattern ¯\_(ツ)_/¯
This commit is contained in:
@@ -56,7 +56,7 @@ export class Script {
|
||||
* Download the script as a file
|
||||
*/
|
||||
download(): void {
|
||||
const filename = this.filename + ".js";
|
||||
const filename = this.filename;
|
||||
const file = new Blob([this.code], { type: "text/plain" });
|
||||
const navigator = window.navigator as any;
|
||||
if (navigator.msSaveOrOpenBlob) {
|
||||
|
||||
Reference in New Issue
Block a user